|
|
|
@ -197,8 +197,12 @@ namespace Compiler
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseInt (value, loc, scanner);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no comma was used between arguments
|
|
|
|
|
scanner.putbackInt (value, loc);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ExprParser::parseFloat (float value, const TokenLoc& loc, Scanner& scanner)
|
|
|
|
@ -211,8 +215,12 @@ namespace Compiler
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseFloat (value, loc, scanner);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no comma was used between arguments
|
|
|
|
|
scanner.putbackFloat (value, loc);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ExprParser::parseName (const std::string& name, const TokenLoc& loc,
|
|
|
|
@ -232,6 +240,12 @@ namespace Compiler
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no comma was used between arguments
|
|
|
|
|
scanner.putbackName (name, loc);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseName (name, loc, scanner);
|
|
|
|
|
}
|
|
|
|
@ -240,7 +254,9 @@ namespace Compiler
|
|
|
|
|
{
|
|
|
|
|
mFirst = false;
|
|
|
|
|
|
|
|
|
|
if (keyword==Scanner::K_getsquareroot && mNextOperand)
|
|
|
|
|
if (mNextOperand)
|
|
|
|
|
{
|
|
|
|
|
if (keyword==Scanner::K_getsquareroot)
|
|
|
|
|
{
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
|
parseArguments ("f", scanner);
|
|
|
|
@ -250,6 +266,13 @@ namespace Compiler
|
|
|
|
|
mNextOperand = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no comma was used between arguments
|
|
|
|
|
scanner.putbackKeyword (keyword, loc);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Parser::parseKeyword (keyword, loc, scanner);
|
|
|
|
|
}
|
|
|
|
@ -290,12 +313,21 @@ namespace Compiler
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (code==Scanner::S_open && mNextOperand)
|
|
|
|
|
if (code==Scanner::S_open)
|
|
|
|
|
{
|
|
|
|
|
if (mNextOperand)
|
|
|
|
|
{
|
|
|
|
|
mOperators.push_back ('(');
|
|
|
|
|
mTokenLoc = loc;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no comma was used between arguments
|
|
|
|
|
scanner.putbackKeyword (code, loc);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (code==Scanner::S_close && !mNextOperand)
|
|
|
|
|
{
|
|
|
|
|