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 10, 2024
1 parent 34e8c4b commit 1d22103
Show file tree
Hide file tree
Showing 29 changed files with 286 additions and 316 deletions.
40 changes: 19 additions & 21 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ codegen_language_macros::compile!(Language(
Enum(
name = SourceUnitMember,
variants = [
EnumVariant(reference = PragmaDirective),
EnumVariant(reference = ImportDirective),
EnumVariant(reference = ContractDefinition),
EnumVariant(reference = InterfaceDefinition),
EnumVariant(reference = LibraryDefinition),
Expand All @@ -72,7 +70,9 @@ codegen_language_macros::compile!(Language(
enabled = From("0.8.8")
),
EnumVariant(reference = UsingDirective, enabled = From("0.8.13")),
EnumVariant(reference = EventDefinition, enabled = From("0.8.22"))
EnumVariant(reference = EventDefinition, enabled = From("0.8.22")),
EnumVariant(reference = PragmaDirective),
EnumVariant(reference = ImportDirective)
]
)
]
Expand Down Expand Up @@ -2120,7 +2120,6 @@ codegen_language_macros::compile!(Language(
Enum(
name = ContractMember,
variants = [
EnumVariant(reference = UsingDirective),
EnumVariant(reference = FunctionDefinition),
EnumVariant(
reference = ConstructorDefinition,
Expand All @@ -2147,7 +2146,8 @@ codegen_language_macros::compile!(Language(
EnumVariant(
reference = UserDefinedValueTypeDefinition,
enabled = From("0.8.8")
)
),
EnumVariant(reference = UsingDirective)
]
)
]
Expand Down Expand Up @@ -2301,12 +2301,12 @@ codegen_language_macros::compile!(Language(
Enum(
name = StateVariableAttribute,
variants = [
EnumVariant(reference = OverrideSpecifier, enabled = From("0.6.0")),
EnumVariant(reference = ConstantKeyword),
EnumVariant(reference = InternalKeyword),
EnumVariant(reference = PrivateKeyword),
EnumVariant(reference = PublicKeyword),
EnumVariant(reference = ImmutableKeyword, enabled = From("0.6.5"))
EnumVariant(reference = ImmutableKeyword, enabled = From("0.6.5")),
EnumVariant(reference = OverrideSpecifier, enabled = From("0.6.0"))
]
)
]
Expand Down Expand Up @@ -2835,11 +2835,7 @@ 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),
Expand All @@ -2853,7 +2849,9 @@ codegen_language_macros::compile!(Language(
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 = TupleDeconstructionStatement),
EnumVariant(reference = ExpressionStatement)
]
),
Struct(
Expand Down Expand Up @@ -3028,9 +3026,9 @@ codegen_language_macros::compile!(Language(
Enum(
name = ForStatementInitialization,
variants = [
EnumVariant(reference = ExpressionStatement),
EnumVariant(reference = VariableDeclarationStatement),
EnumVariant(reference = TupleDeconstructionStatement),
EnumVariant(reference = ExpressionStatement),
EnumVariant(reference = Semicolon)
]
),
Expand Down Expand Up @@ -4161,8 +4159,6 @@ codegen_language_macros::compile!(Language(
Enum(
name = YulStatement,
variants = [
EnumVariant(reference = YulBlock),
EnumVariant(reference = YulFunctionDefinition),
EnumVariant(reference = YulVariableDeclarationStatement),
EnumVariant(reference = YulVariableAssignmentStatement),
EnumVariant(
Expand All @@ -4176,6 +4172,8 @@ codegen_language_macros::compile!(Language(
EnumVariant(reference = YulBreakStatement),
EnumVariant(reference = YulContinueStatement),
EnumVariant(reference = YulLabel, enabled = Till("0.5.0")),
EnumVariant(reference = YulFunctionDefinition),
EnumVariant(reference = YulBlock),
EnumVariant(reference = YulExpression)
]
),
Expand Down Expand Up @@ -4245,8 +4243,8 @@ codegen_language_macros::compile!(Language(
Enum(
name = YulAssignmentOperator,
variants = [
EnumVariant(reference = YulColonAndEqual, enabled = Till("0.5.5")),
EnumVariant(reference = ColonEqual)
EnumVariant(reference = ColonEqual),
EnumVariant(reference = YulColonAndEqual, enabled = Till("0.5.5"))
]
),
Struct(
Expand All @@ -4266,8 +4264,8 @@ codegen_language_macros::compile!(Language(
name = YulStackAssignmentOperator,
enabled = Till("0.5.0"),
variants = [
EnumVariant(reference = YulEqualAndColon),
EnumVariant(reference = EqualColon)
EnumVariant(reference = EqualColon),
EnumVariant(reference = YulEqualAndColon)
]
),
Struct(
Expand Down Expand Up @@ -4305,8 +4303,8 @@ codegen_language_macros::compile!(Language(
Enum(
name = YulSwitchCase,
variants = [
EnumVariant(reference = YulDefaultCase),
EnumVariant(reference = YulValueCase)
EnumVariant(reference = YulValueCase),
EnumVariant(reference = YulDefaultCase)
]
),
Struct(
Expand Down

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

Loading

0 comments on commit 1d22103

Please sign in to comment.