Report illegal tokens in the Yul parser.

This commit is contained in:
chriseth 2020-12-16 12:17:13 +01:00
parent 17293858c0
commit 5c40fb060c
5 changed files with 7 additions and 4 deletions

View File

@ -327,6 +327,9 @@ variant<Literal, Identifier> Parser::parseLiteralOrIdentifier()
case Token::HexStringLiteral:
fatalParserError(3772_error, "Hex literals are not valid in this context.");
break;
case Token::Illegal:
fatalParserError(1465_error, "Illegal token: " + to_string(m_scanner->currentError()));
break;
default:
fatalParserError(1856_error, "Literal or identifier expected.");
}

View File

@ -6,4 +6,4 @@ contract C {
}
}
// ----
// ParserError 1856: (72-73): Literal or identifier expected.
// ParserError 1465: (72-73): Illegal token: Octal numbers not allowed.

View File

@ -2,4 +2,4 @@
let x := 0100
}
// ----
// ParserError 1856: (15-16): Literal or identifier expected.
// ParserError 1465: (15-16): Illegal token: Octal numbers not allowed.

View File

@ -3,4 +3,4 @@
// underflow
}
// ----
// ParserError 1856: (19-32): Literal or identifier expected.
// ParserError 1465: (19-32): Illegal token: Unicode direction override underflow in comment or string literal.

View File

@ -3,4 +3,4 @@
let s := unicode"underflow ";
}
// ----
// ParserError 1856: (35-47): Literal or identifier expected.
// ParserError 1465: (35-47): Illegal token: Invalid character in string.