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

Retrofit {Hex,Decimal}NumberExpression from v2 into v0/v1 spec #657

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Changes from 1 commit
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
Next Next commit
Retrofit {Hex,Decimal}NumberExpression from v2 into v0/v1 spec
  • Loading branch information
Xanewok committed Nov 15, 2023
commit 05203a59dda603121e7e517d2f7d7b1434755a23
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# yaml-language-server: $schema=../../../generated/productions.schema.json

- name: "NumericExpression"
kind: "Parser"
inlined: true
unversioned:
choice:
- reference: "DecimalNumberExpression"
- reference: "HexNumberExpression"

- name: "DecimalNumberExpression"
kind: "Parser"
unversioned:
sequence:
- reference: "DecimalLiteral"
- optional:
reference: "NumberUnit"

- name: "HexNumberExpression"
kind: "Parser"
versioned:
0.4.11:
sequence:
- choice:
- reference: "HexLiteral"
- reference: "DecimalLiteral"
- reference: "HexLiteral"
- optional:
reference: "NumberUnit"
0.5.0:
# "HexLiteral" no longer allows a "NumberUnit"
choice:
- reference: "HexLiteral"
- sequence:
- reference: "DecimalLiteral"
- optional:
reference: "NumberUnit"
# Removed optional "NumberUnit"
reference: "HexLiteral"

- name: "HexLiteral"
kind: "Scanner"
8 changes: 4 additions & 4 deletions crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
@@ -420,10 +420,10 @@ slang_grammar! {
{ removed in "0.7.0" (FinneyKeyword | SzaboKeyword) }
) ;

parser NumericExpression = (
(HexLiteral { removed in "0.5.0" (NumberUnit ?) }) |
(DecimalLiteral (NumberUnit ?))
) ;
inline parser NumericExpression = ( DecimalNumberExpression | HexNumberExpression ) ;

parser DecimalNumberExpression = (DecimalLiteral (NumberUnit ?)) ;
parser HexNumberExpression = (HexLiteral { removed in "0.5.0" (NumberUnit ?) }) ;

inline parser OrOperator = BarBar ;

6 changes: 4 additions & 2 deletions crates/solidity/outputs/cargo/crate/src/generated/kinds.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading