Skip to content

Commit

Permalink
support Yul label statements before 0.5.0 (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Feb 9, 2024
1 parent 37d281c commit 0bfa6b7
Show file tree
Hide file tree
Showing 14 changed files with 262 additions and 126 deletions.
5 changes: 5 additions & 0 deletions .changeset/tall-impalas-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

support Yul label statements before `0.5.0`
32 changes: 19 additions & 13 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3932,6 +3932,7 @@ codegen_language_macros::compile!(Language(
EnumVariant(reference = YulLeaveStatement, enabled = From("0.6.0")),
EnumVariant(reference = YulBreakStatement),
EnumVariant(reference = YulContinueStatement),
EnumVariant(reference = YulLabel, enabled = Till("0.5.0")),
EnumVariant(reference = YulExpression)
]
),
Expand Down Expand Up @@ -4005,19 +4006,6 @@ codegen_language_macros::compile!(Language(
body = Required(YulBlock)
)
),
Struct(
name = YulLeaveStatement,
enabled = From("0.6.0"),
fields = (leave_keyword = Required(YulLeaveKeyword))
),
Struct(
name = YulBreakStatement,
fields = (break_keyword = Required(YulBreakKeyword))
),
Struct(
name = YulContinueStatement,
fields = (continue_keyword = Required(YulContinueKeyword))
),
Struct(
name = YulForStatement,
fields = (
Expand Down Expand Up @@ -4058,6 +4046,24 @@ codegen_language_macros::compile!(Language(
value = Required(YulLiteral),
body = Required(YulBlock)
)
),
Struct(
name = YulLeaveStatement,
enabled = From("0.6.0"),
fields = (leave_keyword = Required(YulLeaveKeyword))
),
Struct(
name = YulBreakStatement,
fields = (break_keyword = Required(YulBreakKeyword))
),
Struct(
name = YulContinueStatement,
fields = (continue_keyword = Required(YulContinueKeyword))
),
Struct(
name = YulLabel,
enabled = Till("0.5.0"),
fields = (label = Required(YulIdentifier), colon = Required(Colon))
)
]
),
Expand Down
1 change: 1 addition & 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.

44 changes: 38 additions & 6 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.

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.

0 comments on commit 0bfa6b7

Please sign in to comment.