Merge pull request #14139 from ethereum/make-plus-binary-only

Make plus binary only (second attempt)
This commit is contained in:
Daniel
2023-04-18 21:20:31 +02:00
committed by GitHub
11 changed files with 29 additions and 24 deletions
+4
View File
@@ -1869,6 +1869,10 @@ ASTPointer<Expression> Parser::parseUnaryExpression(
ASTNodeFactory nodeFactory = _partiallyParsedExpression ?
ASTNodeFactory(*this, _partiallyParsedExpression) : ASTNodeFactory(*this);
Token token = m_scanner->currentToken();
if (token == Token::Add)
fatalParserError(9636_error, "Use of unary + is disallowed.");
if (!_partiallyParsedExpression && (TokenTraits::isUnaryOp(token) || TokenTraits::isCountOp(token)))
{
// prefix expression