Skip to content

Commit

Permalink
DSL v2 grammar fixes
Browse files Browse the repository at this point in the history
- use the correct `lexical_context` for `AssemblyStatement`.
  • Loading branch information
OmarTawfik committed Nov 24, 2023
1 parent 0434b68 commit d545e65
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2883,6 +2883,32 @@ codegen_language_macros::compile!(Language(
expression = Required(NonTerminal(Expression)),
semicolon = Required(Terminal([Semicolon]))
)
),
Struct(
name = AssemblyStatement,
fields = (
assembly_keyword = Required(Terminal([AssemblyKeyword])),
label = Optional(kind = Terminal([AsciiStringLiteral])),
flags = Optional(kind = NonTerminal(AssemblyFlagsDeclaration)),
body = Required(NonTerminal(YulBlock))
)
),
Struct(
name = AssemblyFlagsDeclaration,
error_recovery = FieldsErrorRecovery(
delimiters =
FieldDelimiters(open = open_paren, close = close_paren)
),
fields = (
open_paren = Required(Terminal([OpenParen])),
flags = Required(NonTerminal(AssemblyFlags)),
close_paren = Required(Terminal([CloseParen]))
)
),
Separated(
name = AssemblyFlags,
separated = AsciiStringLiteral,
separator = Comma
)
]
),
Expand Down Expand Up @@ -3966,32 +3992,6 @@ codegen_language_macros::compile!(Language(
title = "Yul Statements",
lexical_context = Yul,
items = [
Struct(
name = AssemblyStatement,
fields = (
assembly_keyword = Required(Terminal([AssemblyKeyword])),
label = Optional(kind = Terminal([AsciiStringLiteral])),
flags = Optional(kind = NonTerminal(AssemblyFlagsDeclaration)),
body = Required(NonTerminal(YulBlock))
)
),
Struct(
name = AssemblyFlagsDeclaration,
error_recovery = FieldsErrorRecovery(
delimiters =
FieldDelimiters(open = open_paren, close = close_paren)
),
fields = (
open_paren = Required(Terminal([OpenParen])),
flags = Required(NonTerminal(AssemblyFlags)),
close_paren = Required(Terminal([CloseParen]))
)
),
Separated(
name = AssemblyFlags,
separated = AsciiStringLiteral,
separator = Comma
),
Struct(
name = YulBlock,
error_recovery = FieldsErrorRecovery(
Expand Down

0 comments on commit d545e65

Please sign in to comment.