Skip to content

Commit

Permalink
support stack assignments in Yul before 0.5.0 (#997)
Browse files Browse the repository at this point in the history
Closes #984
  • Loading branch information
OmarTawfik authored Jun 2, 2024
1 parent cdc153d commit 84ad856
Show file tree
Hide file tree
Showing 282 changed files with 1,125 additions and 635 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-turkeys-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

Support stack assignments in Yul before `0.5.0`.
20 changes: 16 additions & 4 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4154,7 +4154,11 @@ codegen_language_macros::compile!(Language(
EnumVariant(reference = YulBlock),
EnumVariant(reference = YulFunctionDefinition),
EnumVariant(reference = YulVariableDeclarationStatement),
EnumVariant(reference = YulAssignmentStatement),
EnumVariant(reference = YulVariableAssignmentStatement),
EnumVariant(
reference = YulStackAssignmentStatement,
enabled = Till("0.5.0")
),
EnumVariant(reference = YulIfStatement),
EnumVariant(reference = YulForStatement),
EnumVariant(reference = YulSwitchStatement),
Expand Down Expand Up @@ -4221,22 +4225,30 @@ codegen_language_macros::compile!(Language(
)
),
Struct(
name = YulAssignmentStatement,
name = YulVariableAssignmentStatement,
fields = (
names = Required(YulPaths),
assignment = Required(YulAssignmentOperator),
expression = Required(YulExpression)
)
),
Struct(
name = YulStackAssignmentStatement,
enabled = Till("0.5.0"),
fields = (
assignment = Required(YulAssignmentOperator),
expression = Required(YulExpression)
)
),
Enum(
name = YulAssignmentOperator,
variants = [
EnumVariant(reference = YulColonAndEqual, enabled = Till("0.5.5")),
EnumVariant(reference = YulColonEqual, enabled = Till("0.5.5")),
EnumVariant(reference = ColonEqual)
]
),
Struct(
name = YulColonAndEqual,
name = YulColonEqual,
enabled = Till("0.5.5"),
fields = (colon = Required(Colon), equal = Required(Equal))
),
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.

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.

Loading

0 comments on commit 84ad856

Please sign in to comment.