mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10625 from ethereum/reportIllegalTokens
Report illegal tokens in the Yul parser.
This commit is contained in:
commit
e347545597
@ -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.");
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError 1856: (72-73): Literal or identifier expected.
|
||||
// ParserError 1465: (72-73): Illegal token: Octal numbers not allowed.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user