From 75e00573884677b6854a6aea1e4c006978f54f1e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 30 Jul 2020 12:20:15 +0100 Subject: [PATCH] Rename parseElementaryOperation to parseLiteralOrIdentifier --- libyul/AsmParser.cpp | 16 ++++++++-------- libyul/AsmParser.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libyul/AsmParser.cpp b/libyul/AsmParser.cpp index 19d0ced20..94dff259d 100644 --- a/libyul/AsmParser.cpp +++ b/libyul/AsmParser.cpp @@ -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)) fatalParserError(4805_error, "Literal expected."); _case.value = make_unique(std::get(std::move(literal))); @@ -264,7 +264,7 @@ Expression Parser::parseExpression() { RecursionGuard recursionGuard(*this); - ElementaryOperation operation = parseElementaryOperation(); + ElementaryOperation operation = parseLiteralOrIdentifier(); if (holds_alternative(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; diff --git a/libyul/AsmParser.h b/libyul/AsmParser.h index 705711b52..2720e9760 100644 --- a/libyul/AsmParser.h +++ b/libyul/AsmParser.h @@ -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);