Introduce Leave as a keyword for Yul

This commit is contained in:
Alex Beregszaszi
2020-08-28 19:34:52 +01:00
parent caa329066e
commit 4366ede889
4 changed files with 16 additions and 12 deletions
+8 -10
View File
@@ -126,16 +126,14 @@ Statement Parser::parseStatement()
advance();
return stmt;
}
case Token::Identifier:
if (currentLiteral() == "leave")
{
Statement stmt{createWithLocation<Leave>()};
if (!m_insideFunction)
m_errorReporter.syntaxError(8149_error, currentLocation(), "Keyword \"leave\" can only be used inside a function.");
advance();
return stmt;
}
break;
case Token::Leave:
{
Statement stmt{createWithLocation<Leave>()};
if (!m_insideFunction)
m_errorReporter.syntaxError(8149_error, currentLocation(), "Keyword \"leave\" can only be used inside a function.");
advance();
return stmt;
}
default:
break;
}