Skip to content

Commit

Permalink
fix: Allow duplicate indexed event attribute until 0.8.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Apr 4, 2024
1 parent a001a46 commit 2d72772
Show file tree
Hide file tree
Showing 14 changed files with 249 additions and 23 deletions.
19 changes: 18 additions & 1 deletion crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2579,9 +2579,26 @@ codegen_language_macros::compile!(Language(
name = EventParameter,
fields = (
type_name = Required(TypeName),
indexed_keyword = Optional(reference = IndexedKeyword),
indexed_attribute = Optional(reference = EventIndexedAttribute),
name = Optional(reference = Identifier)
)
),
Struct(
name = EventIndexedAttribute,
fields = (
indexed_keyword = Required(IndexedKeyword),
// Replicate solc bug: https://github.com/ethereum/solidity/issues/13681
repeated = Optional(
reference = RepeatedIndexedKeyword,
enabled = Till("0.8.18")
)
)
),
Repeated(
name = RepeatedIndexedKeyword,
reference = IndexedKeyword,
enabled = Till("0.8.18"),
allow_empty = false
)
]
),
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.

47 changes: 43 additions & 4 deletions crates/solidity/outputs/npm/package/src/ast/generated/ast_types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/solidity/outputs/npm/package/src/generated/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion crates/solidity/outputs/spec/generated/grammar.ebnf

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
Expand Up @@ -26,17 +26,19 @@ Tree:
- (parameters꞉ EventParameters): # "uint256 indexed a, uint256 indexed b" (30..66)
- (item꞉ EventParameter): # "uint256 indexed a" (30..47)
- (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ UintKeyword): "uint256" # (30..37)
- (leading_trivia꞉ Whitespace): " " # (37..38)
- (indexed_keyword꞉ IndexedKeyword): "indexed" # (38..45)
- (indexed_attribute꞉ EventIndexedAttribute): # " indexed" (37..45)
- (leading_trivia꞉ Whitespace): " " # (37..38)
- (indexed_keyword꞉ IndexedKeyword): "indexed" # (38..45)
- (leading_trivia꞉ Whitespace): " " # (45..46)
- (name꞉ Identifier): "a" # (46..47)
- (separator꞉ Comma): "," # (47..48)
- (item꞉ EventParameter): # " uint256 indexed b" (48..66)
- (type_name꞉ TypeName) ► (variant꞉ ElementaryType): # " uint256" (48..56)
- (leading_trivia꞉ Whitespace): " " # (48..49)
- (variant꞉ UintKeyword): "uint256" # (49..56)
- (leading_trivia꞉ Whitespace): " " # (56..57)
- (indexed_keyword꞉ IndexedKeyword): "indexed" # (57..64)
- (indexed_attribute꞉ EventIndexedAttribute): # " indexed" (56..64)
- (leading_trivia꞉ Whitespace): " " # (56..57)
- (indexed_keyword꞉ IndexedKeyword): "indexed" # (57..64)
- (leading_trivia꞉ Whitespace): " " # (64..65)
- (name꞉ Identifier): "b" # (65..66)
- (close_paren꞉ CloseParen): ")" # (66..67)
Expand Down
Loading

0 comments on commit 2d72772

Please sign in to comment.