Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve keywords more correctly in DSL v1 #644

Merged
merged 6 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,8 @@ slang_grammar! {
scanner EventKeyword = "event" ;
scanner ExperimentalKeyword = "experimental" ;
scanner ExternalKeyword = "external" ;
scanner FallbackKeyword = "fallback" ;
scanner FalseKeyword = "false" ;
scanner FinalKeyword = "final" ;
scanner FinneyKeyword = "finney" ;
scanner ForKeyword = "for" ;
scanner FromKeyword = "from" ;
scanner FunctionKeyword = "function" ;
Expand All @@ -901,13 +899,11 @@ slang_grammar! {
scanner NewKeyword = "new" ;
scanner NullKeyword = "null" ;
scanner OfKeyword = "of" ;
scanner OverrideKeyword = "override" ;
scanner PayableKeyword = "payable" ;
scanner PragmaKeyword = "pragma" ;
scanner PrivateKeyword = "private" ;
scanner PublicKeyword = "public" ;
scanner PureKeyword = "pure" ;
scanner ReceiveKeyword = "receive" ;
scanner RelocatableKeyword = "relocatable" ;
scanner ReturnKeyword = "return" ;
scanner ReturnsKeyword = "returns" ;
Expand All @@ -918,7 +914,6 @@ slang_grammar! {
scanner StringKeyword = "string" ;
scanner StructKeyword = "struct" ;
scanner SwitchKeyword = "switch" ;
scanner SzaboKeyword = "szabo" ;
scanner ThrowKeyword = "throw" ;
scanner TrueKeyword = "true" ;
scanner TypeKeyword = "type";
Expand All @@ -931,6 +926,9 @@ slang_grammar! {
scanner WhileKeyword = "while" ;
scanner YearsKeyword = "years" ;

// Always reserved but used since 0.6.0
scanner TryKeyword = "try" ;

// introduced in 0.4.21
// WRONG, it is both a keyword AND identifier for some versions.
scanner EmitKeyword = { introduced in "0.4.21" "emit" } ;
Expand All @@ -956,19 +954,25 @@ slang_grammar! {
scanner SupportsKeyword = { introduced in "0.5.0" "supports" } ;
scanner TypedefKeyword = { introduced in "0.5.0" "typedef" } ;

// Introduced in 0.6.0
scanner LeaveKeyword = { introduced in "0.6.0" "leave" } ; // warning: used in yul
scanner TryKeyword = { introduced in "0.6.0" "try" } ;
scanner VirtualKeyword = { introduced in "0.6.0" "virtual" } ;
// Reserved since 0.5.0 and used since 0.8.0
scanner UncheckedKeyword = { introduced in "0.5.0" "unchecked" } ;
// Reserved since 0.5.0 and used since 0.6.5
scanner ImmutableKeyword = { introduced in "0.5.0" "immutable" } ;
// Reserved since 0.5.0 and used since 0.6.0
scanner OverrideKeyword = { introduced in "0.5.0" "override" } ;

// Introduced in 0.6.5
scanner ImmutableKeyword = { introduced in "0.6.5" "immutable" } ;
// Introduced in 0.6.0
scanner FallbackKeyword = { introduced in "0.6.0" "fallback" } ;
scanner ReceiveKeyword = { introduced in "0.6.0" "receive" } ;
scanner LeaveKeyword = { introduced in "0.6.0" "leave" } ; // warning: used in yul
scanner VirtualKeyword = { introduced in "0.6.0" "virtual" } ;

// Introduced in 0.6.11
scanner GweiKeyword = { introduced in "0.6.11" "gwei" } ;

// Introduced in 0.8.0
scanner UncheckedKeyword = { introduced in "0.8.0" "unchecked" } ;
// Removed in 0.7.0
scanner FinneyKeyword = { removed in "0.7.0" "finney" } ;
scanner SzaboKeyword = { removed in "0.7.0" "szabo" } ;

// Introduced in 0.8.4
scanner ErrorKeyword = { introduced in "0.8.4" "error" } ;
Expand Down
138 changes: 80 additions & 58 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.

Loading