allow .123 as float literal syntax. Fixes #103

This commit is contained in:
Irmen de Jong 2023-03-26 21:09:15 +02:00
parent 5cbf859458
commit f67d5faeb7

View File

@ -30,8 +30,10 @@ BIN_INTEGER : '%' ('0' | '1')+ ;
ADDRESS_OF: '&' ;
INVALID_AND_COMPOSITE: '&&' ;
FLOAT_NUMBER : FNUMBER (('E'|'e') ('+' | '-')? FNUMBER)? ; // sign comes later from unary expression
fragment FNUMBER : ('0' .. '9') + ('.' ('0' .. '9') +)? ;
FLOAT_NUMBER : FNUMBER (('E'|'e') ('+' | '-')? DEC_INTEGER)? ; // sign comes later from unary expression
fragment FNUMBER : FDOTNUMBER | FNUMDOTNUMBER ;
fragment FDOTNUMBER : '.' ('0'..'9')+ ;
fragment FNUMDOTNUMBER : ('0'..'9')+ ('.' ('0'..'9')+ )? ;
fragment STRING_ESCAPE_SEQ : '\\' . | '\\x' . . | '\\u' . . . .;
STRING :