-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
Previously, Yul identifiers could have dots in the name but that's not the case starting from 0.7. As such, we need to disallow these forms for the variable declaration and instead only accept the identifier, as is done by the upstream grammar.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@nomicfoundation/slang": patch | ||
--- | ||
|
||
Restrict the grammar to correctly only allow an identifier in Yul variable declaration |
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ let a.b.c := 1 │ 0..14 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected Colon or ColonEqual. | ||
╭─[crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/identifier_with_dots/input.sol:1:6] | ||
│ | ||
1 │ let a.b.c := 1 | ||
│ ─────┬──── | ||
│ ╰────── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (YulVariableDeclarationStatement): # "let a.b.c := 1\n" (0..15) | ||
- (let_keyword꞉ YulLetKeyword): "let" # (0..3) | ||
- (leading_trivia꞉ Whitespace): " " # (3..4) | ||
- (names꞉ YulIdentifier): "a" # (4..5) | ||
- (SKIPPED): ".b.c := 1\n" # (5..15) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ let a.b.c := 1 │ 0..14 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected ColonEqual. | ||
╭─[crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/identifier_with_dots/input.sol:1:6] | ||
│ | ||
1 │ let a.b.c := 1 | ||
│ ─────┬──── | ||
│ ╰────── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (YulVariableDeclarationStatement): # "let a.b.c := 1\n" (0..15) | ||
- (let_keyword꞉ YulLetKeyword): "let" # (0..3) | ||
- (leading_trivia꞉ Whitespace): " " # (3..4) | ||
- (names꞉ YulIdentifier): "a" # (4..5) | ||
- (SKIPPED): ".b.c := 1\n" # (5..15) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ let a.b.c := 1 │ 0..14 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected ColonEqual. | ||
╭─[crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/identifier_with_dots/input.sol:1:6] | ||
│ | ||
1 │ let a.b.c := 1 | ||
│ ─────┬──── | ||
│ ╰────── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (YulVariableDeclarationStatement): # "let a.b.c := 1\n" (0..15) | ||
- (let_keyword꞉ YulLetKeyword): "let" # (0..3) | ||
- (leading_trivia꞉ Whitespace): " " # (3..4) | ||
- (names꞉ YulIdentifier): "a" # (4..5) | ||
- (SKIPPED): ".b.c := 1\n" # (5..15) |
This file was deleted.