Problem with LaxReader and for loops #5

Closed
opened 2023-12-31 17:08:54 +00:00 by tonyg · 1 comment
Owner

Given input such as hello(123; 456 ..., the LaxReader class tries some simple error recovery, effectively closing the open-paren group just before the semicolon. However this seems ill-advised given the validity of for (123; 456 ... and for await (123; 456 ....

Given input such as `hello(123; 456 ...`, the `LaxReader` class tries some simple error recovery, effectively closing the open-paren group just before the semicolon. However this seems ill-advised given the validity of `for (123; 456 ...` and `for await (123; 456 ...`.
Author
Owner

One approach (patch attached) is to exempt for and for await from the recovery. Another is to just not do the error recovery, relying on the existing popUntilMatch code to respond to close-group mismatches. I think I prefer the latter.

One approach (patch attached) is to exempt `for` and `for await` from the recovery. Another is to just not do the error recovery, relying on the existing `popUntilMatch` code to respond to close-group mismatches. I think I prefer the latter.
tonyg closed this issue 2023-12-31 17:14:26 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: syndicate-lang/syndicate-js#5
No description provided.