Commit 44a000fd authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[torque] Add negative decimal literals.

This CL changes the DECIMAL_LITERAL lexer rule to allow
negative decimal literals as well.

This could also be achieved by using the unary minus operation,
which would occur an runtime overhead and feel counter-intuitive
for literals (imho).

R=tebbi@chromium.org

Change-Id: Ib01aa1930254bcd85a161de385b0fd4f176feb46
Reviewed-on: https://chromium-review.googlesource.com/1027473Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#52773}
parent 549a3143
...@@ -107,9 +107,9 @@ fragment EXPONENT_PART ...@@ -107,9 +107,9 @@ fragment EXPONENT_PART
; ;
DECIMAL_LITERAL DECIMAL_LITERAL
: DECIMAL_INTEGER_LITERAL '.' DECIMAL_DIGIT* EXPONENT_PART? : MINUS? DECIMAL_INTEGER_LITERAL '.' DECIMAL_DIGIT* EXPONENT_PART?
| '.' DECIMAL_DIGIT+ EXPONENT_PART? | MINUS? '.' DECIMAL_DIGIT+ EXPONENT_PART?
| DECIMAL_INTEGER_LITERAL EXPONENT_PART? | MINUS? DECIMAL_INTEGER_LITERAL EXPONENT_PART?
; ;
type : IDENTIFIER; type : IDENTIFIER;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment