Skip to content

Commit

Permalink
add private to UnnamedFunctionAttribute till 0.5.0 (#842)
Browse files Browse the repository at this point in the history
Enforced since ethereum/solidity#4376
  • Loading branch information
OmarTawfik authored Feb 22, 2024
1 parent ecbba49 commit 2069126
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/unlucky-trains-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

add `private` to `UnnamedFunctionAttribute` till `0.5.0`
1 change: 1 addition & 0 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2386,6 +2386,7 @@ codegen_language_macros::compile!(Language(
EnumVariant(reference = ExternalKeyword),
EnumVariant(reference = InternalKeyword, enabled = Till("0.5.0")),
EnumVariant(reference = PayableKeyword),
EnumVariant(reference = PrivateKeyword, enabled = Till("0.5.0")),
EnumVariant(reference = PublicKeyword, enabled = Till("0.5.0")),
EnumVariant(reference = PureKeyword),
EnumVariant(reference = ViewKeyword)
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.

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.

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 () private {} │ 0..22
Errors: []

Tree:
- (UnnamedFunctionDefinition): # "function () private {}\n" (0..23)
- (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): # " private" (11..19)
- (item꞉ UnnamedFunctionAttribute): # " private" (11..19)
- (LeadingTrivia) ► (Whitespace): " " # (11..12)
- (variant꞉ PrivateKeyword): "private" # (12..19)
- (body꞉ FunctionBody) ► (variant꞉ Block): # " {}\n" (19..23)
- (LeadingTrivia) ► (Whitespace): " " # (19..20)
- (open_brace꞉ OpenBrace): "{" # (20..21)
- (close_brace꞉ CloseBrace): "}" # (21..22)
- (TrailingTrivia) ► (EndOfLine): "\n" # (22..23)
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 () private {} │ 0..22
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/private_attribute/input.sol:1:12]
1 │ function () private {}
│ ──────┬─────
│ ╰─────── Error occurred here.
───╯
Tree:
- (UnnamedFunctionDefinition): # "function () private {}\n" (0..23)
- (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): " private {}\n" # (11..23)
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 () private {} │ 0..22
Errors: # 1 total
- >
Error: Expected end of file.
╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/input.sol:1:1]
1 │ function () private {}
│ ───────────┬───────────
│ ╰───────────── Error occurred here.
───╯
Tree:
- (SKIPPED): "function () private {}\n" # (0..23)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function () private {}

0 comments on commit 2069126

Please sign in to comment.