-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't consume the dot in decimal literals if not followed by dig…
…it since 0.5.0 (#891) See ethereum/solidity#4172. This unblocks parsing member access expressions where the primary expression can't consume the dot in order to parse the `.member` postfix expression.
- Loading branch information
Showing
34 changed files
with
480 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@nomicfoundation/slang": patch | ||
--- | ||
|
||
Fix parsing `<NUMBER>.member` member access expression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 39 additions & 19 deletions
58
crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
crates/solidity/outputs/cargo/tests/src/cst_output/generated/decimal_number_expression.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
crates/solidity/outputs/cargo/tests/src/cst_output/generated/expression.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
crates/solidity/outputs/spec/generated/public/05-expressions/04-numbers.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
.../cst_output/DecimalNumberExpression/float_ident_after_period/generated/0.4.11-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1.2.a │ 0..5 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword or YearsKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4] | ||
│ | ||
1 │ 1.2.a | ||
│ ─┬─ | ||
│ ╰─── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1.2.a\n" (0..6) | ||
- (literal꞉ DecimalLiteral): "1.2" # (0..3) | ||
- (SKIPPED): ".a\n" # (3..6) |
19 changes: 19 additions & 0 deletions
19
...s/cst_output/DecimalNumberExpression/float_ident_after_period/generated/0.5.0-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1.2.a │ 0..5 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4] | ||
│ | ||
1 │ 1.2.a | ||
│ ─┬─ | ||
│ ╰─── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1.2.a\n" (0..6) | ||
- (literal꞉ DecimalLiteral): "1.2" # (0..3) | ||
- (SKIPPED): ".a\n" # (3..6) |
19 changes: 19 additions & 0 deletions
19
.../cst_output/DecimalNumberExpression/float_ident_after_period/generated/0.6.11-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1.2.a │ 0..5 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4] | ||
│ | ||
1 │ 1.2.a | ||
│ ─┬─ | ||
│ ╰─── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1.2.a\n" (0..6) | ||
- (literal꞉ DecimalLiteral): "1.2" # (0..3) | ||
- (SKIPPED): ".a\n" # (3..6) |
19 changes: 19 additions & 0 deletions
19
...s/cst_output/DecimalNumberExpression/float_ident_after_period/generated/0.7.0-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1.2.a │ 0..5 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4] | ||
│ | ||
1 │ 1.2.a | ||
│ ─┬─ | ||
│ ╰─── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1.2.a\n" (0..6) | ||
- (literal꞉ DecimalLiteral): "1.2" # (0..3) | ||
- (SKIPPED): ".a\n" # (3..6) |
1 change: 1 addition & 0 deletions
1
...y/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.2.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...apshots/cst_output/DecimalNumberExpression/float_no_fraction/generated/0.6.11-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1. │ 0..2 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:2] | ||
│ | ||
1 │ 1. | ||
│ ┬ | ||
│ ╰── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1." (0..2) | ||
- (literal꞉ DecimalLiteral): "1" # (0..1) | ||
- (SKIPPED): "." # (1..2) |
19 changes: 19 additions & 0 deletions
19
...napshots/cst_output/DecimalNumberExpression/float_no_fraction/generated/0.7.0-failure.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ 1. │ 0..2 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword. | ||
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:2] | ||
│ | ||
1 │ 1. | ||
│ ┬ | ||
│ ╰── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (DecimalNumberExpression): # "1." (0..2) | ||
- (literal꞉ DecimalLiteral): "1" # (0..1) | ||
- (SKIPPED): "." # (1..2) |
Oops, something went wrong.