Skip to content

Commit

Permalink
unreserve pragma keywords in all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Feb 22, 2024
1 parent 4341597 commit 89ae5bb
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-waves-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

unreserve pragma keywords in all versions
19 changes: 14 additions & 5 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,28 @@ codegen_language_macros::compile!(Language(
)]
),
Keyword(
name = SolidityKeyword,
name = AbicoderKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("solidity"))]
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("abicoder")
)]
),
Keyword(
name = ExperimentalKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("experimental"))]
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("experimental")
)]
),
Keyword(
name = AbicoderKeyword,
name = SolidityKeyword,
identifier = Identifier,
definitions = [KeywordDefinition(value = Atom("abicoder"))]
definitions = [KeywordDefinition(
reserved = Never,
value = Atom("solidity")
)]
)
]
),
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.

7 changes: 5 additions & 2 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,19 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ // Always valid as an identifier (never reserved): │ 0..50
2 │ uint abicoder; │ 51..65
Errors: []

Tree:
- (VariableDeclarationStatement): # "// Always valid as an identifier (never reserved):..." (0..66)
- (variable_type꞉ VariableDeclarationType) ► (variant꞉ TypeName) ► (variant꞉ ElementaryType): # "// Always valid as an identifier (never reserved):..." (0..55)
- (LeadingTrivia): # "// Always valid as an identifier (never reserved):..." (0..51)
- (SingleLineComment): "// Always valid as an identifier (never reserved):" # (0..50)
- (EndOfLine): "\n" # (50..51)
- (variant꞉ UintKeyword): "uint" # (51..55)
- (LeadingTrivia) ► (Whitespace): " " # (55..56)
- (name꞉ Identifier): "abicoder" # (56..64)
- (semicolon꞉ Semicolon): ";" # (64..65)
- (TrailingTrivia) ► (EndOfLine): "\n" # (65..66)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Always valid as an identifier (never reserved):
uint abicoder;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ // Always valid as an identifier (never reserved): │ 0..50
2 │ uint experimental; │ 51..69
Errors: []

Tree:
- (VariableDeclarationStatement): # "// Always valid as an identifier (never reserved):..." (0..70)
- (variable_type꞉ VariableDeclarationType) ► (variant꞉ TypeName) ► (variant꞉ ElementaryType): # "// Always valid as an identifier (never reserved):..." (0..55)
- (LeadingTrivia): # "// Always valid as an identifier (never reserved):..." (0..51)
- (SingleLineComment): "// Always valid as an identifier (never reserved):" # (0..50)
- (EndOfLine): "\n" # (50..51)
- (variant꞉ UintKeyword): "uint" # (51..55)
- (LeadingTrivia) ► (Whitespace): " " # (55..56)
- (name꞉ Identifier): "experimental" # (56..68)
- (semicolon꞉ Semicolon): ";" # (68..69)
- (TrailingTrivia) ► (EndOfLine): "\n" # (69..70)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Always valid as an identifier (never reserved):
uint experimental;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ // Always valid as an identifier (never reserved): │ 0..50
2 │ uint solidity; │ 51..65
Errors: []

Tree:
- (VariableDeclarationStatement): # "// Always valid as an identifier (never reserved):..." (0..66)
- (variable_type꞉ VariableDeclarationType) ► (variant꞉ TypeName) ► (variant꞉ ElementaryType): # "// Always valid as an identifier (never reserved):..." (0..55)
- (LeadingTrivia): # "// Always valid as an identifier (never reserved):..." (0..51)
- (SingleLineComment): "// Always valid as an identifier (never reserved):" # (0..50)
- (EndOfLine): "\n" # (50..51)
- (variant꞉ UintKeyword): "uint" # (51..55)
- (LeadingTrivia) ► (Whitespace): " " # (55..56)
- (name꞉ Identifier): "solidity" # (56..64)
- (semicolon꞉ Semicolon): ";" # (64..65)
- (TrailingTrivia) ► (EndOfLine): "\n" # (65..66)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Always valid as an identifier (never reserved):
uint solidity;

0 comments on commit 89ae5bb

Please sign in to comment.