Fixed trailing underscores in numeric literals (#1264)

This change prohibits such illegal numeric literals as 13_37_ or 0xCAFE_BABE_ (note the trailing underscore).
This commit is contained in:
Nikolas Havrikov
2017-08-26 15:07:35 +02:00
committed by Dmitry Jemerov
parent fac207ce7c
commit 3d8b15d9db
+7 -3
View File
@@ -7,7 +7,9 @@ Digit
: ["0".."9"];
IntegerLiteral
: Digit (Digit | "_")*
: Digit
: Digit (Digit | "_")* Digit
;
FloatLiteral
: <Java double literal>;
@@ -17,7 +19,9 @@ HexDigit
: Digit | ["A".."F", "a".."f"];
HexadecimalLiteral
: "0x" HexDigit (HexDigit | "_")*;
: "0x" HexDigit
: "0x" HexDigit (HexDigit | "_")* HexDigit
;
CharacterLiteral
: <character as in Java>;
@@ -136,4 +140,4 @@ internal
protected
catch
finally
*/
*/