Skip to content

Commit

Permalink
re-order enums in grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Aug 11, 2024
1 parent 34e8c4b commit 9545003
Show file tree
Hide file tree
Showing 16 changed files with 248 additions and 276 deletions.
30 changes: 15 additions & 15 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2835,25 +2835,25 @@ codegen_language_macros::compile!(Language(
Enum(
name = Statement,
variants = [
// Simple statements
EnumVariant(reference = ExpressionStatement),
EnumVariant(reference = VariableDeclarationStatement),
EnumVariant(reference = TupleDeconstructionStatement),
// Control statements
EnumVariant(reference = IfStatement),
EnumVariant(reference = ForStatement),
EnumVariant(reference = WhileStatement),
EnumVariant(reference = DoWhileStatement),
EnumVariant(reference = ContinueStatement),
// Variants that can be identified using the first token:
EnumVariant(reference = AssemblyStatement),
EnumVariant(reference = Block),
EnumVariant(reference = BreakStatement),
EnumVariant(reference = ContinueStatement),
EnumVariant(reference = DoWhileStatement),
EnumVariant(reference = EmitStatement, enabled = From("0.4.21")),
EnumVariant(reference = ForStatement),
EnumVariant(reference = IfStatement),
EnumVariant(reference = ReturnStatement),
EnumVariant(reference = RevertStatement, enabled = From("0.8.4")),
EnumVariant(reference = ThrowStatement, enabled = Till("0.5.0")),
EnumVariant(reference = EmitStatement, enabled = From("0.4.21")),
EnumVariant(reference = TryStatement, enabled = From("0.6.0")),
EnumVariant(reference = RevertStatement, enabled = From("0.8.4")),
EnumVariant(reference = AssemblyStatement),
EnumVariant(reference = Block),
EnumVariant(reference = UncheckedBlock, enabled = From("0.8.0"))
EnumVariant(reference = UncheckedBlock, enabled = From("0.8.0")),
EnumVariant(reference = WhileStatement),
// These variants are more complex, and require backtracking:
EnumVariant(reference = VariableDeclarationStatement),
EnumVariant(reference = TupleDeconstructionStatement),
EnumVariant(reference = ExpressionStatement)
]
),
Struct(
Expand Down

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.

26 changes: 13 additions & 13 deletions crates/solidity/outputs/spec/generated/grammar.ebnf

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

Loading

0 comments on commit 9545003

Please sign in to comment.