Closed albertolovato closed 6 years ago
I am rather sure the parser requires at least a "null-statement" like CONTINUE between a block statement.
* An "empty" loop is not recognised
* the parser expects at least one Statement
* so if your remove the comment on CONTINUE => it works
PERFORM VARYING X-3 FROM 1 BY 1 UNTIL X-3 > Z-T-MAX
* CONTINUE
END-PERFORM
errormessage is:
Preprocessing file ISSUE09.CBL.
Parsing file ISSUE09.CBL.
line 28:11 no viable alternative at input 'Z-T-MAXEND-PERFORM'
Collecting units in file ISSUE09.CBL.
You found a bug with perform statements. Perform statements required at least one nested statement to be parsed.
Fixed in 1eef9037af6bd8332f8637d68863eb9b100ec749. Added a unit test for the code provided by you.
Thanks to both of you!
Sometimes putting
END-<statement>
stops parsing, for example withPERFORM UNTIL x NOT = SPACE END-PERFORM.
The same happens with END-ACCEPT and END-IF