Skip to content

Commit

Permalink
allow parsing ColonEqual as two separate tokens before 0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Feb 28, 2024
1 parent 67dfde8 commit 541ca08
Show file tree
Hide file tree
Showing 41 changed files with 386 additions and 88 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-rocks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

allow parsing `ColonEqual` as two separate tokens before `0.5.5`
23 changes: 20 additions & 3 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,12 @@ codegen_language_macros::compile!(Language(
),
Token(
name = Colon,
definitions = [TokenDefinition(scanner = Atom(":"))]
definitions = [TokenDefinition(
scanner = TrailingContext(
scanner = Atom(":"),
not_followed_by = Atom("=")
)
)]
),
Token(
name = ColonEqual,
Expand Down Expand Up @@ -4061,18 +4066,30 @@ codegen_language_macros::compile!(Language(
Struct(
name = YulVariableDeclarationValue,
fields = (
colon_equal = Required(ColonEqual),
assignment = Required(YulAssignmentOperator),
expression = Required(YulExpression)
)
),
Struct(
name = YulAssignmentStatement,
fields = (
names = Required(YulIdentifierPaths),
colon_equal = Required(ColonEqual),
assignment = Required(YulAssignmentOperator),
expression = Required(YulExpression)
)
),
Enum(
name = YulAssignmentOperator,
variants = [
EnumVariant(reference = YulColonAndEqual, enabled = Till("0.5.5")),
EnumVariant(reference = ColonEqual)
]
),
Struct(
name = YulColonAndEqual,
enabled = Till("0.5.5"),
fields = (colon = Required(Colon), equal = Required(Equal))
),
Struct(
name = YulIfStatement,
fields = (
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.

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 541ca08

Please sign in to comment.