diff --git a/Engine/source/console/torquescript/astNodes.cpp b/Engine/source/console/torquescript/astNodes.cpp index b7d84e1bc..bea3dca4f 100644 --- a/Engine/source/console/torquescript/astNodes.cpp +++ b/Engine/source/console/torquescript/astNodes.cpp @@ -49,12 +49,6 @@ namespace Compiler } } -bool hasTrailingNumber(StringTableEntry varName) { - size_t len = dStrlen(varName); - if (len == 0) return false; // empty string - return dIsdigit((unsigned char)varName[len - 1]); -} - using namespace Compiler; FuncVars gEvalFuncVars; @@ -670,7 +664,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) precompileIdent(varName); - bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName); + bool oldVariables = arrayIndex || varName[0] == '$'; if (oldVariables) { @@ -719,7 +713,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) TypeReq VarNode::getPreferredType() { - bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName); + bool oldVariables = arrayIndex || varName[0] == '$'; return oldVariables ? TypeReqNone : getFuncVars(dbgLineNumber)->lookupType(varName, dbgLineNumber); } @@ -919,7 +913,7 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) ip = expr->compile(codeStream, ip, subType); - bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName); + bool oldVariables = arrayIndex || varName[0] == '$'; if (oldVariables) { @@ -1053,7 +1047,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type) getAssignOpTypeOp(op, subType, operand); precompileIdent(varName); - bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName); + bool oldVariables = arrayIndex || varName[0] == '$'; if (op == opPLUSPLUS && !oldVariables && type == TypeReqNone) {