Merge pull request #12971 from shekhirin/fix-parser-error

fix(parser): error for unexpected token
This commit is contained in:
chriseth 2022-05-02 11:26:36 +02:00 committed by GitHub
commit c3a5c83d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View File

@ -142,7 +142,7 @@ ASTPointer<SourceUnit> Parser::parse(CharStream& _charStream)
expectToken(Token::Semicolon); expectToken(Token::Semicolon);
} }
else else
fatalParserError(7858_error, "Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition."); fatalParserError(7858_error, "Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.");
} }
} }
solAssert(m_recursionDepth == 0, ""); solAssert(m_recursionDepth == 0, "");

View File

@ -1,4 +1,4 @@
Error: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. Error: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.
--> recovery_ast_empty_contract/input.sol:3:1: --> recovery_ast_empty_contract/input.sol:3:1:
| |
3 | c 3 | c

View File

@ -1,3 +1,3 @@
constructor() {} constructor() {}
// ---- // ----
// ParserError 7858: (0-11): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. // ParserError 7858: (0-11): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.

View File

@ -1,3 +1,3 @@
fallback(){} fallback(){}
// ---- // ----
// ParserError 7858: (0-8): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. // ParserError 7858: (0-8): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.

View File

@ -1,3 +1,3 @@
receive() {} receive() {}
// ---- // ----
// ParserError 7858: (0-7): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. // ParserError 7858: (0-7): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.

View File

@ -1,3 +1,3 @@
unexpected unexpected
// ---- // ----
// ParserError 7858: (0-10): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. // ParserError 7858: (0-10): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/error definition.