DavidKinder / Inform6

The latest version of the Inform 6 compiler, used for generating interactive fiction games.
http://inform-fiction.org/
Other
199 stars 32 forks source link

Unterminated array definition causes lots of errors #246

Closed erkyrath closed 9 months ago

erkyrath commented 9 months ago

An array with no semicolon and nothing after it:

Array arr --> 1 2 3 4

...causes a semi-infinite loop of

line 2: Error: Expected expression but found

After 100 of these (MAX_ERRORS), it cuts itself off:

line 2: Fatal error: Too many errors: giving up

The problem is that parse_expression() can generate an error, but the caller (the array statement) can't detect that fact to exit its loop.

Perhaps define a new ERROR_MV marker value which indicates this case?