1
0
Fork 0

make newline optional member of a statement

This commit is contained in:
Kevin Matz 2018-10-20 15:54:47 -04:00
parent 7758b76c7d
commit 9b46389801
1 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@ grammar CommentMacro;
prog : statement+ EOF ;
statement : macro (':' macro)* NEWLINE
statement : macro (':' macro)* NEWLINE?
| NEWLINE
;
@ -70,6 +70,9 @@ number : NUMBER ;
** LEXAR Rules
**/
fragment DIGIT : [0-9] ;
NUMBER : DIGIT+ ('.' DIGIT+)? ;
SLASH : '/' ;
THRU : '>' ;
NEXT : '+' ;
@ -81,11 +84,8 @@ WHOLEHOG : [hH] ;
DP8K : [dD] ;
IOP : 'IOP';
fragment DIGIT : [0-9] ;
NUMBER : DIGIT+ ('.' DIGIT+)? ;
NEWLINE : '\r'? '\n' ; // return newlines to parser
WS : [ \t]+ -> skip ; // ignore whitespace
NEWLINE : '\r'? '\n' ; // return newlines to parser
WS : [ \t]+ -> skip ; // ignore whitespace
COMMENT // toss c and HTML sytle block comments
: ( '<!--' .*? '-->'