|
@@ -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;
|
|
using namespace Compiler;
|
|
|
|
|
|
|
|
FuncVars gEvalFuncVars;
|
|
FuncVars gEvalFuncVars;
|
|
@@ -670,7 +664,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
|
|
|
|
|
|
|
|
precompileIdent(varName);
|
|
precompileIdent(varName);
|
|
|
|
|
|
|
|
- bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName);
|
|
|
|
|
|
|
+ bool oldVariables = arrayIndex || varName[0] == '$';
|
|
|
|
|
|
|
|
if (oldVariables)
|
|
if (oldVariables)
|
|
|
{
|
|
{
|
|
@@ -719,7 +713,7 @@ U32 VarNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
|
|
|
|
|
|
|
|
TypeReq VarNode::getPreferredType()
|
|
TypeReq VarNode::getPreferredType()
|
|
|
{
|
|
{
|
|
|
- bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName);
|
|
|
|
|
|
|
+ bool oldVariables = arrayIndex || varName[0] == '$';
|
|
|
return oldVariables ? TypeReqNone : getFuncVars(dbgLineNumber)->lookupType(varName, dbgLineNumber);
|
|
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);
|
|
ip = expr->compile(codeStream, ip, subType);
|
|
|
|
|
|
|
|
- bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName);
|
|
|
|
|
|
|
+ bool oldVariables = arrayIndex || varName[0] == '$';
|
|
|
|
|
|
|
|
if (oldVariables)
|
|
if (oldVariables)
|
|
|
{
|
|
{
|
|
@@ -1053,7 +1047,7 @@ U32 AssignOpExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
|
|
|
getAssignOpTypeOp(op, subType, operand);
|
|
getAssignOpTypeOp(op, subType, operand);
|
|
|
precompileIdent(varName);
|
|
precompileIdent(varName);
|
|
|
|
|
|
|
|
- bool oldVariables = arrayIndex || varName[0] == '$' || hasTrailingNumber(varName);
|
|
|
|
|
|
|
+ bool oldVariables = arrayIndex || varName[0] == '$';
|
|
|
|
|
|
|
|
if (op == opPLUSPLUS && !oldVariables && type == TypeReqNone)
|
|
if (op == opPLUSPLUS && !oldVariables && type == TypeReqNone)
|
|
|
{
|
|
{
|