-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix parsing empty
/**/
comments (#844)
- Loading branch information
1 parent
b7a5791
commit f62de9e
Showing
14 changed files
with
187 additions
and
2 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 empty `/**/` comments |
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
6 changes: 5 additions & 1 deletion
6
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.
20 changes: 20 additions & 0 deletions
20
crates/solidity/outputs/cargo/tests/src/cst_output/generated/SourceUnit.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...ots/cst_output/SourceUnit/empty_multiline_comment_1_asterisk/generated/0.4.11-success.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,11 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ /*/ needs another one to terminate: /*/ │ 0..39 | ||
Errors: [] | ||
|
||
Tree: | ||
- (SourceUnit) ► (LeadingTrivia): # "/*/ needs another one to terminate: /*/\n" (0..40) | ||
- (MultiLineComment): "/*/ needs another one to terminate: /*/" # (0..39) | ||
- (EndOfLine): "\n" # (39..40) |
1 change: 1 addition & 0 deletions
1
...dity/testing/snapshots/cst_output/SourceUnit/empty_multiline_comment_1_asterisk/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 @@ | ||
/*/ needs another one to terminate: /*/ |
11 changes: 11 additions & 0 deletions
11
...ts/cst_output/SourceUnit/empty_multiline_comment_2_asterisks/generated/0.4.11-success.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,11 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ /**/ │ 0..4 | ||
Errors: [] | ||
|
||
Tree: | ||
- (SourceUnit) ► (LeadingTrivia): # "/**/\n" (0..5) | ||
- (MultiLineComment): "/**/" # (0..4) | ||
- (EndOfLine): "\n" # (4..5) |
1 change: 1 addition & 0 deletions
1
...ity/testing/snapshots/cst_output/SourceUnit/empty_multiline_comment_2_asterisks/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 @@ | ||
/**/ |
11 changes: 11 additions & 0 deletions
11
...ts/cst_output/SourceUnit/empty_multiline_comment_3_asterisks/generated/0.4.11-success.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,11 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ /***/ │ 0..5 | ||
Errors: [] | ||
|
||
Tree: | ||
- (SourceUnit) ► (LeadingTrivia): # "/***/\n" (0..6) | ||
- (MultiLineNatSpecComment): "/***/" # (0..5) | ||
- (EndOfLine): "\n" # (5..6) |
1 change: 1 addition & 0 deletions
1
...ity/testing/snapshots/cst_output/SourceUnit/empty_multiline_comment_3_asterisks/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 @@ | ||
/***/ |
11 changes: 11 additions & 0 deletions
11
...ts/cst_output/SourceUnit/empty_multiline_comment_4_asterisks/generated/0.4.11-success.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,11 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ /****/ │ 0..6 | ||
Errors: [] | ||
|
||
Tree: | ||
- (SourceUnit) ► (LeadingTrivia): # "/****/\n" (0..7) | ||
- (MultiLineNatSpecComment): "/****/" # (0..6) | ||
- (EndOfLine): "\n" # (6..7) |
1 change: 1 addition & 0 deletions
1
...ity/testing/snapshots/cst_output/SourceUnit/empty_multiline_comment_4_asterisks/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 @@ | ||
/****/ |
53 changes: 53 additions & 0 deletions
53
...s/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.6.2-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,53 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ (a, b) = (123, 135) │ 0..19 | ||
2 │ /**/ │ 20..24 | ||
3 │ { throw; │ 25..34 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected CloseBrace or Identifier. | ||
╭─[crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/input.sol:3:3] | ||
│ | ||
3 │ { throw; | ||
│ ──┬── | ||
│ ╰──── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (TupleDeconstructionStatement): # "(a, b) = (123, 135)\n/**/\n{ throw; \n" (0..35) | ||
- (open_paren꞉ OpenParen): "(" # (0..1) | ||
- (elements꞉ TupleDeconstructionElements): # "a, b" (1..5) | ||
- (item꞉ TupleDeconstructionElement) ► (member꞉ TupleMember) ► (variant꞉ UntypedTupleMember) ► (name꞉ Identifier): "a" # (1..2) | ||
- (separator꞉ Comma): "," # (2..3) | ||
- (item꞉ TupleDeconstructionElement) ► (member꞉ TupleMember) ► (variant꞉ UntypedTupleMember): # " b" (3..5) | ||
- (LeadingTrivia) ► (Whitespace): " " # (3..4) | ||
- (name꞉ Identifier): "b" # (4..5) | ||
- (close_paren꞉ CloseParen): ")" # (5..6) | ||
- (LeadingTrivia) ► (Whitespace): " " # (6..7) | ||
- (equal꞉ Equal): "=" # (7..8) | ||
- (expression꞉ Expression): # " (123, 135)\n/**/\n{" (8..26) | ||
- (variant꞉ TupleExpression): # " (123, 135)\n" (8..20) | ||
- (LeadingTrivia) ► (Whitespace): " " # (8..9) | ||
- (open_paren꞉ OpenParen): "(" # (9..10) | ||
- (items꞉ TupleValues): # "123, 135" (10..18) | ||
- (item꞉ TupleValue) ► (expression꞉ Expression) ► (variant꞉ DecimalNumberExpression) ► (literal꞉ DecimalLiteral): "123" # (10..13) | ||
- (separator꞉ Comma): "," # (13..14) | ||
- (item꞉ TupleValue) ► (expression꞉ Expression) ► (variant꞉ DecimalNumberExpression): # " 135" (14..18) | ||
- (LeadingTrivia) ► (Whitespace): " " # (14..15) | ||
- (literal꞉ DecimalLiteral): "135" # (15..18) | ||
- (close_paren꞉ CloseParen): ")" # (18..19) | ||
- (TrailingTrivia) ► (EndOfLine): "\n" # (19..20) | ||
- (options꞉ FunctionCallOptions) ► (variant꞉ NamedArgumentGroups): # "/**/\n{" (20..26) | ||
- (item꞉ NamedArgumentGroup): # "/**/\n{" (20..26) | ||
- (LeadingTrivia): # "/**/\n" (20..25) | ||
- (MultiLineComment): "/**/" # (20..24) | ||
- (EndOfLine): "\n" # (24..25) | ||
- (open_brace꞉ OpenBrace): "{" # (25..26) | ||
- (LeadingTrivia) ► (Whitespace): " " # (26..27) | ||
- (SKIPPED): "throw" # (27..32) | ||
- (semicolon꞉ Semicolon): ";" # (32..33) | ||
- (TrailingTrivia): # " \n" (33..35) | ||
- (Whitespace): " " # (33..34) | ||
- (EndOfLine): "\n" # (34..35) |
52 changes: 52 additions & 0 deletions
52
...s/cst_output/TupleDeconstructionStatement/invalid_termination/generated/0.8.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,52 @@ | ||
# This file is generated automatically by infrastructure scripts. Please don't edit by hand. | ||
|
||
Source: > | ||
1 │ (a, b) = (123, 135) │ 0..19 | ||
2 │ /**/ │ 20..24 | ||
3 │ { throw; │ 25..34 | ||
Errors: # 1 total | ||
- > | ||
Error: Expected CloseBrace or Identifier. | ||
╭─[crates/solidity/testing/snapshots/cst_output/TupleDeconstructionStatement/invalid_termination/input.sol:3:3] | ||
│ | ||
3 │ { throw; | ||
│ ──┬── | ||
│ ╰──── Error occurred here. | ||
───╯ | ||
Tree: | ||
- (TupleDeconstructionStatement): # "(a, b) = (123, 135)\n/**/\n{ throw; \n" (0..35) | ||
- (open_paren꞉ OpenParen): "(" # (0..1) | ||
- (elements꞉ TupleDeconstructionElements): # "a, b" (1..5) | ||
- (item꞉ TupleDeconstructionElement) ► (member꞉ TupleMember) ► (variant꞉ UntypedTupleMember) ► (name꞉ Identifier): "a" # (1..2) | ||
- (separator꞉ Comma): "," # (2..3) | ||
- (item꞉ TupleDeconstructionElement) ► (member꞉ TupleMember) ► (variant꞉ UntypedTupleMember): # " b" (3..5) | ||
- (LeadingTrivia) ► (Whitespace): " " # (3..4) | ||
- (name꞉ Identifier): "b" # (4..5) | ||
- (close_paren꞉ CloseParen): ")" # (5..6) | ||
- (LeadingTrivia) ► (Whitespace): " " # (6..7) | ||
- (equal꞉ Equal): "=" # (7..8) | ||
- (expression꞉ Expression): # " (123, 135)\n/**/\n{" (8..26) | ||
- (variant꞉ TupleExpression): # " (123, 135)\n" (8..20) | ||
- (LeadingTrivia) ► (Whitespace): " " # (8..9) | ||
- (open_paren꞉ OpenParen): "(" # (9..10) | ||
- (items꞉ TupleValues): # "123, 135" (10..18) | ||
- (item꞉ TupleValue) ► (expression꞉ Expression) ► (variant꞉ DecimalNumberExpression) ► (literal꞉ DecimalLiteral): "123" # (10..13) | ||
- (separator꞉ Comma): "," # (13..14) | ||
- (item꞉ TupleValue) ► (expression꞉ Expression) ► (variant꞉ DecimalNumberExpression): # " 135" (14..18) | ||
- (LeadingTrivia) ► (Whitespace): " " # (14..15) | ||
- (literal꞉ DecimalLiteral): "135" # (15..18) | ||
- (close_paren꞉ CloseParen): ")" # (18..19) | ||
- (TrailingTrivia) ► (EndOfLine): "\n" # (19..20) | ||
- (options꞉ FunctionCallOptions) ► (variant꞉ NamedArgumentGroup): # "/**/\n{" (20..26) | ||
- (LeadingTrivia): # "/**/\n" (20..25) | ||
- (MultiLineComment): "/**/" # (20..24) | ||
- (EndOfLine): "\n" # (24..25) | ||
- (open_brace꞉ OpenBrace): "{" # (25..26) | ||
- (LeadingTrivia) ► (Whitespace): " " # (26..27) | ||
- (SKIPPED): "throw" # (27..32) | ||
- (semicolon꞉ Semicolon): ";" # (32..33) | ||
- (TrailingTrivia): # " \n" (33..35) | ||
- (Whitespace): " " # (33..34) | ||
- (EndOfLine): "\n" # (34..35) |