Skip to content

Commit

Permalink
fix: Mark RevertStatement as introduced in 0.8.4
Browse files Browse the repository at this point in the history
It was introduced alongside the `revert` contextual keyword,
see ethereum/solidity#11037.
  • Loading branch information
Xanewok committed Sep 19, 2023
1 parent 59c30dd commit 510d8cf
Show file tree
Hide file tree
Showing 22 changed files with 132 additions and 22 deletions.
7 changes: 4 additions & 3 deletions crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ slang_grammar! {
parser ContractMembersList = (ContractMember +) ;

inline parser ControlStatement = (
IfStatement | ForStatement | WhileStatement | DoWhileStatement | ContinueStatement | BreakStatement | DeleteStatement | ReturnStatement | RevertStatement |
{ introduced in "0.4.21" EmitStatement} |
IfStatement | ForStatement | WhileStatement | DoWhileStatement | ContinueStatement | BreakStatement | DeleteStatement | ReturnStatement |
{ introduced in "0.4.21" EmitStatement } |
{ removed in "0.5.0" ThrowStatement } |
{ introduced in "0.6.0" TryStatement}
{ introduced in "0.6.0" TryStatement } |
{ introduced in "0.8.4" RevertStatement }
) ;

inline parser DataLocation = (
Expand Down
6 changes: 4 additions & 2 deletions crates/solidity/outputs/cargo/crate/src/generated/language.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or ThrowKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or VarKeyword or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Errors: # 2 total
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ function someFunc() public { │ 0..28
2 │ { │ 29..34
3 │ uint256 arg = (1 + 2; │ 35..64
4 │ }) │ 65..71
5 │ } │ 72..73

Errors: # 2 total
- >
Error: Expected CloseParen or Comma.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:3:29]
3 │ ╭─▶ uint256 arg = (1 + 2;
4 │ ├─▶ })
│ │
│ ╰──────────── Error occurred here.
───╯
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or CloseBrace or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TryKeyword or TypeKeyword or UncheckedKeyword or UnicodeStringLiteral or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ContractMembersList/mismatched_delimiter/input.sol:4:6]
4 │ })
│ ─┬
│ ╰── Error occurred here.
───╯

Tree:
- ContractMembersList (Rule): # 0..74 "function someFunc() public {\n {\n uint256..."
- FunctionDefinition (Rule): # 0..74 "function someFunc() public {\n {\n uint256..."
- FunctionKeyword (Token): "function" # 0..8
- Identifier (Token): "someFunc" # 9..17
- ParametersDeclaration (Rule): # 17..19 "()"
- OpenParen (Token): "(" # 17..18
- CloseParen (Token): ")" # 18..19
- FunctionAttributesList (Rule): # 19..26 " public"
- PublicKeyword (Token): "public" # 20..26
- Block (Rule): # 26..74 " {\n {\n uint256 arg = (1 + 2;\n })\n}\n"
- OpenBrace (Token): "{" # 27..28
- StatementsList (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }"
- Statement (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }"
- Block (Rule): # 29..70 " {\n uint256 arg = (1 + 2;\n }"
- OpenBrace (Token): "{" # 33..34
- StatementsList (Rule): # 35..63 " uint256 arg = (1 + 2"
- Statement (Rule): # 35..63 " uint256 arg = (1 + 2"
- VariableDeclarationStatement (Rule): # 35..63 " uint256 arg = (1 + 2"
- VariableDeclaration (Rule): # 35..54 " uint256 arg"
- TypeName (Rule): # 35..50 " uint256"
- UnsignedIntegerType (Token): "uint256" # 43..50
- Identifier (Token): "arg" # 51..54
- Equal (Token): "=" # 55..56
- Expression (Rule): # 56..63 " (1 + 2"
- TupleExpression (Rule): # 56..63 " (1 + 2"
- OpenParen (Token): "(" # 57..58
- TupleValuesList (Rule): # 58..63 "1 + 2"
- Expression (Rule): # 58..63 "1 + 2"
- BinaryExpression (Rule): # 58..63 "1 + 2"
- Expression (Rule): # 58..59 "1"
- NumericExpression (Rule): # 58..59 "1"
- DecimalLiteral (Token): "1" # 58..59
- Plus (Token): "+" # 60..61
- Expression (Rule): # 61..63 " 2"
- NumericExpression (Rule): # 61..63 " 2"
- DecimalLiteral (Token): "2" # 62..63
- SKIPPED (Token): ";\n " # 63..69
- CloseBrace (Token): "}" # 69..70
- SKIPPED (Token): ")\n" # 70..72
- CloseBrace (Token): "}" # 72..73
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Source: >

Errors: # 1 total
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1]
1 │ throw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Source: >

Errors: # 1 total
- >
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or RevertKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
Error: Expected AddressKeyword or AsciiStringLiteral or AssemblyKeyword or BoolKeyword or BreakKeyword or ByteKeyword or ContinueKeyword or DecimalLiteral or DeleteKeyword or DoKeyword or EmitKeyword or FalseKeyword or FixedBytesType or ForKeyword or FunctionKeyword or HexLiteral or HexStringLiteral or Identifier or IfKeyword or MappingKeyword or NewKeyword or OpenBrace or OpenBracket or OpenParen or PayableKeyword or ReturnKeyword or SignedFixedType or SignedIntegerType or StringKeyword or TrueKeyword or TypeKeyword or UnsignedFixedType or UnsignedIntegerType or WhileKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/Statement/throw/input.sol:1:1]
1 │ throw;
Expand Down
Loading

0 comments on commit 510d8cf

Please sign in to comment.