Skip to content

Commit

Permalink
add OverrideKeyword to ConstructorAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Feb 22, 2024
1 parent 6b6f260 commit c05a2d2
Show file tree
Hide file tree
Showing 16 changed files with 141 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-kiwis-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

add `OverrideKeyword` to `ConstructorAttribute`
4 changes: 4 additions & 0 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,10 @@ codegen_language_macros::compile!(Language(
variants = [
EnumVariant(reference = ModifierInvocation),
EnumVariant(reference = InternalKeyword),
EnumVariant(
reference = OverrideKeyword,
enabled = Range(from = "0.6.0", till = "0.6.7")
),
EnumVariant(reference = PayableKeyword),
EnumVariant(reference = PublicKeyword)
]
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.

1 change: 1 addition & 0 deletions 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.

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,17 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ constructor () override {} │ 0..26
Errors: # 1 total
- >
Error: Expected end of file.
╭─[crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/input.sol:1:1]
1 │ constructor () override {}
│ ─────────────┬─────────────
│ ╰─────────────── Error occurred here.
───╯
Tree:
- (SKIPPED): "constructor () override {}\n" # (0..27)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ constructor () override {} │ 0..26
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (open_paren꞉ OpenParen): "(" # (12..13)
- (close_paren꞉ CloseParen): ")" # (13..14)
- (attributes꞉ ConstructorAttributes): # " override" (14..23)
- (item꞉ ConstructorAttribute) ► (variant꞉ ModifierInvocation) ► (name꞉ IdentifierPath): # " override" (14..23)
- (LeadingTrivia) ► (Whitespace): " " # (14..15)
- (item꞉ Identifier): "override" # (15..23)
- (body꞉ Block): # " {}\n" (23..27)
- (LeadingTrivia) ► (Whitespace): " " # (23..24)
- (open_brace꞉ OpenBrace): "{" # (24..25)
- (close_brace꞉ CloseBrace): "}" # (25..26)
- (TrailingTrivia) ► (EndOfLine): "\n" # (26..27)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ constructor () override {} │ 0..26
Errors: # 1 total
- >
Error: Expected Identifier or InternalKeyword or OpenBrace or PayableKeyword or PublicKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/input.sol:1:15]
1 │ constructor () override {}
│ ──────┬──────
│ ╰──────── Error occurred here.
───╯
Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (open_paren꞉ OpenParen): "(" # (12..13)
- (close_paren꞉ CloseParen): ")" # (13..14)
- (SKIPPED): " override {}\n" # (14..27)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ constructor () override {} │ 0..26
Errors: []

Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (open_paren꞉ OpenParen): "(" # (12..13)
- (close_paren꞉ CloseParen): ")" # (13..14)
- (attributes꞉ ConstructorAttributes): # " override" (14..23)
- (item꞉ ConstructorAttribute): # " override" (14..23)
- (LeadingTrivia) ► (Whitespace): " " # (14..15)
- (variant꞉ OverrideKeyword): "override" # (15..23)
- (body꞉ Block): # " {}\n" (23..27)
- (LeadingTrivia) ► (Whitespace): " " # (23..24)
- (open_brace꞉ OpenBrace): "{" # (24..25)
- (close_brace꞉ CloseBrace): "}" # (25..26)
- (TrailingTrivia) ► (EndOfLine): "\n" # (26..27)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ constructor () override {} │ 0..26
Errors: # 1 total
- >
Error: Expected Identifier or InternalKeyword or OpenBrace or PayableKeyword or PublicKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/ConstructorDefinition/override_attribute/input.sol:1:15]
1 │ constructor () override {}
│ ──────┬──────
│ ╰──────── Error occurred here.
───╯
Tree:
- (ConstructorDefinition): # "constructor () override {}\n" (0..27)
- (constructor_keyword꞉ ConstructorKeyword): "constructor" # (0..11)
- (parameters꞉ ParametersDeclaration): # " ()" (11..14)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (open_paren꞉ OpenParen): "(" # (12..13)
- (close_paren꞉ CloseParen): ")" # (13..14)
- (SKIPPED): " override {}\n" # (14..27)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
constructor () override {}

0 comments on commit c05a2d2

Please sign in to comment.