Skip to content

Commit

Permalink
Merge branch 'parse-numeric-methods' into sanctuary-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Mar 9, 2024
2 parents 6cc963c + 788f76d commit aad75bf
Show file tree
Hide file tree
Showing 33 changed files with 441 additions and 5 deletions.
15 changes: 15 additions & 0 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3703,6 +3703,21 @@ codegen_language_macros::compile!(Language(
not_followed_by = Fragment(IdentifierStart)
)
),
// Since 0.5.0, only consume a dot if it's followed by a digit:
TokenDefinition(
enabled = From("0.5.0"),
scanner = TrailingContext(
scanner = Sequence([
Fragment(DecimalDigits),
Optional(Sequence([
Atom("."),
Fragment(DecimalDigits)
])),
Optional(Fragment(DecimalExponent))
]),
not_followed_by = Fragment(IdentifierStart)
)
),
// A dot and a fraction (without an integer) is enabled in all versions:
TokenDefinition(
scanner = TrailingContext(
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.

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

Source: >
1 │ 1.2.a │ 0..5
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword or YearsKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4]
1 │ 1.2.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.2.a\n" (0..6)
- (literal꞉ DecimalLiteral): "1.2" # (0..3)
- (SKIPPED): ".a\n" # (3..6)
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 │ 1.2.a │ 0..5
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4]
1 │ 1.2.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.2.a\n" (0..6)
- (literal꞉ DecimalLiteral): "1.2" # (0..3)
- (SKIPPED): ".a\n" # (3..6)
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 │ 1.2.a │ 0..5
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4]
1 │ 1.2.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.2.a\n" (0..6)
- (literal꞉ DecimalLiteral): "1.2" # (0..3)
- (SKIPPED): ".a\n" # (3..6)
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 │ 1.2.a │ 0..5
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_ident_after_period/input.sol:1:4]
1 │ 1.2.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.2.a\n" (0..6)
- (literal꞉ DecimalLiteral): "1.2" # (0..3)
- (SKIPPED): ".a\n" # (3..6)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.a
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ Source: >
Errors: # 1 total
- >
Error: Expected DecimalLiteral.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:1]
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:2]
1 │ 1.
│ ╰── Error occurred here.
───╯
Tree:
- (SKIPPED): "1." # (0..2)
- (DecimalNumberExpression): # "1." (0..2)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): "." # (1..2)
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 │ 1. │ 0..2
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:2]
1 │ 1.
│ ┬
│ ╰── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1." (0..2)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): "." # (1..2)
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 │ 1. │ 0..2
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/float_no_fraction/input.sol:1:2]
1 │ 1.
│ ┬
│ ╰── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1." (0..2)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): "." # (1..2)
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 │ 1.a │ 0..3
Errors: # 1 total
- >
Error: Expected DecimalLiteral.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/input.sol:1:1]
1 │ 1.a
│ ──┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (SKIPPED): "1.a\n" # (0..4)
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 │ 1.a │ 0..3
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/input.sol:1:2]
1 │ 1.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.a\n" (0..4)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): ".a\n" # (1..4)
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 │ 1.a │ 0..3
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/input.sol:1:2]
1 │ 1.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.a\n" (0..4)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): ".a\n" # (1..4)
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 │ 1.a │ 0..3
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or GweiKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or WeeksKeyword or WeiKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/integer_ident_after_period/input.sol:1:2]
1 │ 1.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # "1.a\n" (0..4)
- (literal꞉ DecimalLiteral): "1" # (0..1)
- (SKIPPED): ".a\n" # (1..4)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.a
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 │ .1a │ 0..3
Errors: # 1 total
- >
Error: Expected DecimalLiteral.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_decimal/input.sol:1:1]
1 │ .1a
│ ──┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (SKIPPED): ".1a\n" # (0..4)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.1a
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 │ .1.a │ 0..4
Errors: # 1 total
- >
Error: Expected DaysKeyword or EtherKeyword or FinneyKeyword or HoursKeyword or MinutesKeyword or SecondsKeyword or SzaboKeyword or WeeksKeyword or WeiKeyword or YearsKeyword.
╭─[crates/solidity/testing/snapshots/cst_output/DecimalNumberExpression/leading_period_ident_after_period/input.sol:1:3]
1 │ .1.a
│ ─┬─
│ ╰─── Error occurred here.
───╯
Tree:
- (DecimalNumberExpression): # ".1.a\n" (0..5)
- (literal꞉ DecimalLiteral): ".1" # (0..2)
- (SKIPPED): ".a\n" # (2..5)
Loading

0 comments on commit aad75bf

Please sign in to comment.