Skip to content

Commit

Permalink
Introduce ErrorParametersDeclaration in v0/v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 15, 2023
1 parent b716ed0 commit 456f77c
Show file tree
Hide file tree
Showing 19 changed files with 187 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@
sequence:
- reference: "ErrorKeyword"
- reference: "Identifier"
- delimitedBy:
open:
reference: "OpenParen"
parser:
optional:
reference: "ErrorParametersList"
close:
reference: "CloseParen"
- reference: "ErrorParametersDeclaration"
terminator:
reference: "Semicolon"

- name: "ErrorParametersDeclaration"
kind: "Parser"
versioned:
0.8.4:
delimitedBy:
open:
reference: "OpenParen"
parser:
optional:
reference: "ErrorParametersList"
close:
reference: "CloseParen"

- name: "ErrorParametersList"
kind: "Parser"
versioned:
Expand Down
4 changes: 3 additions & 1 deletion crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ slang_grammar! {

inline parser EqualityComparisonOperator = (EqualEqual | BangEqual) ;

parser ErrorDefinition = { introduced in "0.8.4" ((ErrorKeyword Identifier ((ErrorParametersList ?) delimited by OpenParen and CloseParen)) terminated by Semicolon) } ;
parser ErrorDefinition = { introduced in "0.8.4" ((ErrorKeyword Identifier ErrorParametersDeclaration) terminated by Semicolon) } ;

parser ErrorParametersDeclaration = { introduced in "0.8.4" ((ErrorParametersList ?) delimited by OpenParen and CloseParen) } ;

parser ErrorParameter = { introduced in "0.8.4" (TypeName (Identifier ?)) } ;

Expand Down
2 changes: 2 additions & 0 deletions crates/solidity/outputs/cargo/crate/src/generated/kinds.rs

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

67 changes: 66 additions & 1 deletion 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.

2 changes: 2 additions & 0 deletions crates/solidity/outputs/npm/crate/src/generated/kinds.rs

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

67 changes: 66 additions & 1 deletion crates/solidity/outputs/npm/crate/src/generated/language.rs

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

2 changes: 2 additions & 0 deletions crates/solidity/outputs/npm/package/src/generated/index.d.ts

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

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

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

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

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

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

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

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

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 @@ -16,7 +16,8 @@ Tree:
- ErrorDefinition (Rule): # 18..36 " error Error1();\n"
- ErrorKeyword (Token): "error" # 20..25
- Identifier (Token): "Error1" # 26..32
- OpenParen (Token): "(" # 32..33
- CloseParen (Token): ")" # 33..34
- ErrorParametersDeclaration (Rule): # 32..34 "()"
- OpenParen (Token): "(" # 32..33
- CloseParen (Token): ")" # 33..34
- Semicolon (Token): ";" # 34..35
- CloseBrace (Token): "}" # 36..37
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Tree:
- ErrorDefinition (Rule): # 0..16 "error MyError();"
- ErrorKeyword (Token): "error" # 0..5
- Identifier (Token): "MyError" # 6..13
- OpenParen (Token): "(" # 13..14
- CloseParen (Token): ")" # 14..15
- ErrorParametersDeclaration (Rule): # 13..15 "()"
- OpenParen (Token): "(" # 13..14
- CloseParen (Token): ")" # 14..15
- Semicolon (Token): ";" # 15..16
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ Tree:
- ErrorDefinition (Rule): # 181..200 "\nerror E1(string);\n"
- ErrorKeyword (Token): "error" # 182..187
- Identifier (Token): "E1" # 188..190
- OpenParen (Token): "(" # 190..191
- ErrorParametersList (Rule): # 191..197 "string"
- ErrorParameter (Rule): # 191..197 "string"
- TypeName (Rule): # 191..197 "string"
- StringKeyword (Token): "string" # 191..197
- CloseParen (Token): ")" # 197..198
- ErrorParametersDeclaration (Rule): # 190..198 "(string)"
- OpenParen (Token): "(" # 190..191
- ErrorParametersList (Rule): # 191..197 "string"
- ErrorParameter (Rule): # 191..197 "string"
- TypeName (Rule): # 191..197 "string"
- StringKeyword (Token): "string" # 191..197
- CloseParen (Token): ")" # 197..198
- Semicolon (Token): ";" # 198..199
- UserDefinedValueTypeDefinition (Rule): # 200..217 "\ntype T is bool;\n"
- TypeKeyword (Token): "type" # 201..205
Expand Down
Loading

0 comments on commit 456f77c

Please sign in to comment.