Skip to content

Commit

Permalink
Retrofit {Hex,Decimal}NumberExpression from v2 into v0/v1 spec (#657)
Browse files Browse the repository at this point in the history
Part of #652 

Split out of #650
  • Loading branch information
Xanewok authored Nov 15, 2023
1 parent d9ea3bf commit 35165c4
Show file tree
Hide file tree
Showing 123 changed files with 703 additions and 634 deletions.
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"
Expand Down
8 changes: 4 additions & 4 deletions crates/solidity/inputs/language/src/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,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 ;

Expand Down
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

0 comments on commit 35165c4

Please sign in to comment.