Skip to content

Conversation

@inmaldrerah
Copy link

This PR fixes bug of incorrect unclosed delimiter error handling:

  1. Only FinalError is ignored in Parser.parse(), and other exceptions are reported as internal errors. (commit 00c7de5)
  2. unclosedDelimiterError may cause IndexOutOfBounds exception because there unexpected ConsumeErrors are caught and handled as unclosed delimiter errors (where the cosume error comes from something else, e.g. failure to consume an identifier). It's now fixed by adding more consume error handling and shrinking try blocks to include only the expected helper.consume() call. (in commit 02e6c0d)
  3. Create and use helper.previousNonNLTokenWithIndex() method to obtain the correct opening delimiter token. (also in commit 02e6c0d)
  4. Correctly print ErrorUnclosedDelimiter with an error message pointing to the unclosed opening delimiter and an info message showing the current token where the parser finds that the opening delimiter should have been (but isn't) closed. (commit f33581d)

Unexpected errors are now logged with stack trace
Now it correctly shows where the unclosed delimiter is and where the parser finds that it is unclosed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant