Skip to content

Commit

Permalink
add public and internal to UnnamedFunctionAttribute till 0.5.0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik authored Feb 13, 2024
1 parent 9aba0d9 commit 59e1e53
Show file tree
Hide file tree
Showing 17 changed files with 173 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/happy-pugs-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

add `public` and `internal` to `UnnamedFunctionAttribute` till `0.5.0`
2 changes: 2 additions & 0 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,9 @@ codegen_language_macros::compile!(Language(
EnumVariant(reference = ModifierInvocation),
EnumVariant(reference = OverrideSpecifier),
EnumVariant(reference = ExternalKeyword),
EnumVariant(reference = InternalKeyword, enabled = Till("0.5.0")),
EnumVariant(reference = PayableKeyword),
EnumVariant(reference = PublicKeyword, enabled = Till("0.5.0")),
EnumVariant(reference = PureKeyword),
EnumVariant(reference = ViewKeyword)
]
Expand Down
14 changes: 14 additions & 0 deletions crates/solidity/outputs/cargo/crate/src/generated/language.rs

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.

2 changes: 2 additions & 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.

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 │ function () internal {} │ 0..23
Errors: []

Tree:
- (UnnamedFunctionDefinition): # "function () internal {}\n" (0..24)
- (function_keyword꞉ FunctionKeyword): "function" # (0..8)
- (parameters꞉ ParametersDeclaration): # " ()" (8..11)
- (LeadingTrivia) ► (Whitespace): " " # (8..9)
- (open_paren꞉ OpenParen): "(" # (9..10)
- (close_paren꞉ CloseParen): ")" # (10..11)
- (attributes꞉ UnnamedFunctionAttributes): # " internal" (11..20)
- (item꞉ UnnamedFunctionAttribute): # " internal" (11..20)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (variant꞉ InternalKeyword): "internal" # (12..20)
- (body꞉ FunctionBody) ► (variant꞉ Block): # " {}\n" (20..24)
- (LeadingTrivia) ► (Whitespace): " " # (20..21)
- (open_brace꞉ OpenBrace): "{" # (21..22)
- (close_brace꞉ CloseBrace): "}" # (22..23)
- (TrailingTrivia) ► (EndOfLine): "\n" # (23..24)
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 │ function () internal {} │ 0..23
Errors: # 1 total
- >
Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/input.sol:1:12]
1 │ function () internal {}
│ ──────┬──────
│ ╰──────── Error occurred here.
───╯
Tree:
- (UnnamedFunctionDefinition): # "function () internal {}\n" (0..24)
- (function_keyword꞉ FunctionKeyword): "function" # (0..8)
- (parameters꞉ ParametersDeclaration): # " ()" (8..11)
- (LeadingTrivia) ► (Whitespace): " " # (8..9)
- (open_paren꞉ OpenParen): "(" # (9..10)
- (close_paren꞉ CloseParen): ")" # (10..11)
- (SKIPPED): " internal {}\n" # (11..24)
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 │ function () internal {} │ 0..23
Errors: # 1 total
- >
Error: Expected end of file.
╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/input.sol:1:1]
1 │ function () internal {}
│ ────────────┬───────────
│ ╰───────────── Error occurred here.
───╯
Tree:
- (SKIPPED): "function () internal {}\n" # (0..24)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function () internal {}
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 │ function () public {} │ 0..21
Errors: []

Tree:
- (UnnamedFunctionDefinition): # "function () public {}\n" (0..22)
- (function_keyword꞉ FunctionKeyword): "function" # (0..8)
- (parameters꞉ ParametersDeclaration): # " ()" (8..11)
- (LeadingTrivia) ► (Whitespace): " " # (8..9)
- (open_paren꞉ OpenParen): "(" # (9..10)
- (close_paren꞉ CloseParen): ")" # (10..11)
- (attributes꞉ UnnamedFunctionAttributes): # " public" (11..18)
- (item꞉ UnnamedFunctionAttribute): # " public" (11..18)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (variant꞉ PublicKeyword): "public" # (12..18)
- (body꞉ FunctionBody) ► (variant꞉ Block): # " {}\n" (18..22)
- (LeadingTrivia) ► (Whitespace): " " # (18..19)
- (open_brace꞉ OpenBrace): "{" # (19..20)
- (close_brace꞉ CloseBrace): "}" # (20..21)
- (TrailingTrivia) ► (EndOfLine): "\n" # (21..22)
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 │ function () public {} │ 0..21
Errors: # 1 total
- >
Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/input.sol:1:12]
1 │ function () public {}
│ ─────┬─────
│ ╰─────── Error occurred here.
───╯
Tree:
- (UnnamedFunctionDefinition): # "function () public {}\n" (0..22)
- (function_keyword꞉ FunctionKeyword): "function" # (0..8)
- (parameters꞉ ParametersDeclaration): # " ()" (8..11)
- (LeadingTrivia) ► (Whitespace): " " # (8..9)
- (open_paren꞉ OpenParen): "(" # (9..10)
- (close_paren꞉ CloseParen): ")" # (10..11)
- (SKIPPED): " public {}\n" # (11..22)
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 │ function () public {} │ 0..21
Errors: # 1 total
- >
Error: Expected end of file.
╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/input.sol:1:1]
1 │ function () public {}
│ ───────────┬──────────
│ ╰──────────── Error occurred here.
───╯
Tree:
- (SKIPPED): "function () public {}\n" # (0..22)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function () public {}

0 comments on commit 59e1e53

Please sign in to comment.