diff --git a/Engine/source/console/CMDscan.l b/Engine/source/console/CMDscan.l index e9069fe15..ccf933bd7 100644 --- a/Engine/source/console/CMDscan.l +++ b/Engine/source/console/CMDscan.l @@ -213,6 +213,7 @@ HEXDIGIT [a-fA-F0-9] "true" { CMDlval.i = MakeToken< int >( 1, lineIndex ); return INTCONST; } "false" { CMDlval.i = MakeToken< int >( 0, lineIndex ); return INTCONST; } {VAR} { return(Sc_ScanVar()); } + {ID} { return Sc_ScanIdent(); } 0[xX]{HEXDIGIT}+ return(Sc_ScanHex()); {INTEGER} { CMDtext[CMDleng] = 0; CMDlval.i = MakeToken< int >( dAtoi(CMDtext), lineIndex ); return INTCONST; } diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 14f610bd2..9fa5c1e11 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -165,7 +165,7 @@ static U32 conversionOp(TypeReq src, TypeReq dst) case TypeReqString: return OP_FLT_TO_STR; case TypeReqNone: - return OP_FLT_TO_NONE; + return OP_NUM_TO_NONE; default: break; } @@ -179,7 +179,7 @@ static U32 conversionOp(TypeReq src, TypeReq dst) case TypeReqString: return OP_UINT_TO_STR; case TypeReqNone: - return OP_UINT_TO_NONE; + return OP_NUM_TO_NONE; default: break; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 559e921c3..47345aae1 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -1215,12 +1215,6 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) break; } - case OP_FLT_TO_NONE: - { - Con::printf("%i: OP_FLT_TO_NONE", ip - 1); - break; - } - case OP_UINT_TO_FLT: { Con::printf("%i: OP_UINT_TO_FLT", ip - 1); @@ -1233,9 +1227,9 @@ void CodeBlock::dumpInstructions(U32 startIp, bool upToReturn) break; } - case OP_UINT_TO_NONE: + case OP_NUM_TO_NONE: { - Con::printf("%i: OP_UINT_TO_NONE", ip - 1); + Con::printf("%i: OP_NUM_TO_NONE", ip - 1); break; } diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index c1db544eb..b39a29133 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -1547,10 +1547,6 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _STK--; break; - case OP_FLT_TO_NONE: - _STK--; - break; - case OP_UINT_TO_FLT: numStack[_STK].f = (F64)numStack[_STK].i; break; @@ -1560,7 +1556,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa _STK--; break; - case OP_UINT_TO_NONE: + case OP_NUM_TO_NONE: _STK--; break; diff --git a/Engine/source/console/compiler.h b/Engine/source/console/compiler.h index c58fff3e6..f0633deab 100644 --- a/Engine/source/console/compiler.h +++ b/Engine/source/console/compiler.h @@ -137,10 +137,9 @@ namespace Compiler OP_STR_TO_NONE, // 60 OP_FLT_TO_UINT, OP_FLT_TO_STR, - OP_FLT_TO_NONE, OP_UINT_TO_FLT, OP_UINT_TO_STR, - OP_UINT_TO_NONE, + OP_NUM_TO_NONE, OP_LOADIMMED_UINT, OP_LOADIMMED_FLT, diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index a544aad0e..4f6971eb8 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -2595,7 +2595,7 @@ ConsoleValue _BaseEngineConsoleCallbackHelper::_exec() // Cannot invoke callback until object has been registered if (mThis->isProperlyAdded()) { - ConsoleValue returnValue = std::move(Con::_internalExecute( mThis, mArgc, mArgv, false )); + ConsoleValue returnValue = Con::_internalExecute( mThis, mArgc, mArgv, false ); mArgc = mInitialArgc; // reset return std::move(returnValue); } diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index 763adc564..d42c202a7 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -175,14 +175,14 @@ class ConsoleValue } public: - ConsoleValue() + explicit ConsoleValue() { - setEmptyString(); + type = ConsoleValueType::cvSTEntry; + s = const_cast(StringTable->EmptyString()); } ConsoleValue(ConsoleValue&& ref) noexcept { - cleanupData(); type = ref.type; switch (ref.type) @@ -217,7 +217,6 @@ public: TORQUE_FORCEINLINE void reset() { - cleanupData(); setEmptyString(); }