* #40: fix grammar rules module and block s.t. we don't need a "synthesized double EOF" (behavior remains exactly the same)

This commit is contained in:
meisl 2021-06-14 22:17:30 +02:00
parent ce76a7dfa5
commit fcb1a7e4d4

View File

@ -73,9 +73,12 @@ ARRAYSIG :
cpuregister: 'A' | 'X' | 'Y';
register: 'A' | 'X' | 'Y' | 'AX' | 'AY' | 'XY' | 'Pc' | 'Pz' | 'Pn' | 'Pv' | 'R0' | 'R1' | 'R2' | 'R3' | 'R4' | 'R5' | 'R6' | 'R7' | 'R8' | 'R9' | 'R10' | 'R11' | 'R12' | 'R13' | 'R14' | 'R15';
module : (directive | block | EOL)* EOF ;
// A module (file) consists of zero or more directives or blocks, in any order.
// If there are more than one, then they must be separated by EOL (one or more newlines).
// However, trailing EOL is NOT required.
module: EOL? ((directive | block) (EOL (directive | block))*)? EOL? EOF;
block: identifier integerliteral? '{' EOL (block_statement | EOL) * '}' (EOL | EOF) ;
block: identifier integerliteral? '{' EOL (block_statement | EOL)* '}';
block_statement: