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:
committed by
Dmitry Jemerov
parent
fac207ce7c
commit
3d8b15d9db
@@ -7,7 +7,9 @@ Digit
|
|||||||
: ["0".."9"];
|
: ["0".."9"];
|
||||||
|
|
||||||
IntegerLiteral
|
IntegerLiteral
|
||||||
: Digit (Digit | "_")*
|
: Digit
|
||||||
|
: Digit (Digit | "_")* Digit
|
||||||
|
;
|
||||||
|
|
||||||
FloatLiteral
|
FloatLiteral
|
||||||
: <Java double literal>;
|
: <Java double literal>;
|
||||||
@@ -17,7 +19,9 @@ HexDigit
|
|||||||
: Digit | ["A".."F", "a".."f"];
|
: Digit | ["A".."F", "a".."f"];
|
||||||
|
|
||||||
HexadecimalLiteral
|
HexadecimalLiteral
|
||||||
: "0x" HexDigit (HexDigit | "_")*;
|
: "0x" HexDigit
|
||||||
|
: "0x" HexDigit (HexDigit | "_")* HexDigit
|
||||||
|
;
|
||||||
|
|
||||||
CharacterLiteral
|
CharacterLiteral
|
||||||
: <character as in Java>;
|
: <character as in Java>;
|
||||||
@@ -136,4 +140,4 @@ internal
|
|||||||
protected
|
protected
|
||||||
catch
|
catch
|
||||||
finally
|
finally
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user