Rename parseElementaryOperation to parseLiteralOrIdentifier

This commit is contained in:
Alex Beregszaszi 2020-07-30 12:20:15 +01:00 committed by chriseth
parent 3da2b67b67
commit 75e0057388
2 changed files with 9 additions and 9 deletions

View File

@ -138,11 +138,11 @@ Statement Parser::parseStatement()
default:
break;
}
// Options left:
// Simple instruction (might turn into functional),
// literal,
// identifier (might turn into label or functional assignment)
ElementaryOperation elementary(parseElementaryOperation());
// Expression/FunctionCall
// Assignment
ElementaryOperation elementary(parseLiteralOrIdentifier());
switch (currentToken())
{
@ -184,7 +184,7 @@ Statement Parser::parseStatement()
expectToken(Token::Comma);
elementary = parseElementaryOperation();
elementary = parseLiteralOrIdentifier();
}
expectToken(Token::AssemblyAssign);
@ -225,7 +225,7 @@ Case Parser::parseCase()
else if (currentToken() == Token::Case)
{
advance();
ElementaryOperation literal = parseElementaryOperation();
ElementaryOperation literal = parseLiteralOrIdentifier();
if (!holds_alternative<Literal>(literal))
fatalParserError(4805_error, "Literal expected.");
_case.value = make_unique<Literal>(std::get<Literal>(std::move(literal)));
@ -264,7 +264,7 @@ Expression Parser::parseExpression()
{
RecursionGuard recursionGuard(*this);
ElementaryOperation operation = parseElementaryOperation();
ElementaryOperation operation = parseLiteralOrIdentifier();
if (holds_alternative<Identifier>(operation))
{
if (currentToken() == Token::LParen)
@ -278,7 +278,7 @@ Expression Parser::parseExpression()
}
}
Parser::ElementaryOperation Parser::parseElementaryOperation()
Parser::ElementaryOperation Parser::parseLiteralOrIdentifier()
{
RecursionGuard recursionGuard(*this);
ElementaryOperation ret;

View File

@ -84,7 +84,7 @@ protected:
Expression parseExpression();
/// Parses an elementary operation, i.e. a literal, identifier, instruction or
/// builtin functian call (only the name).
ElementaryOperation parseElementaryOperation();
ElementaryOperation parseLiteralOrIdentifier();
VariableDeclaration parseVariableDeclaration();
FunctionDefinition parseFunctionDefinition();
Expression parseCall(ElementaryOperation&& _initialOp);