Skip to content

Commit

Permalink
Fixed bug #843
Browse files Browse the repository at this point in the history
  • Loading branch information
leuat committed Feb 25, 2024
1 parent 4c114be commit 57f42b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/Compiler/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ QString Parser::VerifyVariableName(QString v)
}
bool ok=false;
auto temp = v.toInt(&ok, 16);
if (ok)
if (ok) {
qDebug() << "renaming " <<v;
return Syntax::s.m_currentSystem->m_renamedVariablePrefix+v;
}

return v;
}
Expand Down Expand Up @@ -1711,7 +1713,8 @@ QSharedPointer<Node> Parser::Variable(bool isSubVar)
m_isClassReference = m_currentToken.m_isReference;
}

m_currentToken.m_value = VerifyVariableName(m_currentToken.m_value);
if (m_currentToken.m_type!=TokenType::STRING && m_currentToken.m_type!=TokenType::CSTRING)
m_currentToken.m_value = VerifyVariableName(m_currentToken.m_value);
// Rename "i" with "_var_i" for disallowed variables (Z80, GB)

// Subvar can't be CONST
Expand Down

0 comments on commit 57f42b6

Please sign in to comment.