Skip to content

feat: AnalogParserErrorListener for both parser and lexer - #122

Merged
yhteoh merged 3 commits into
v1.0from
error_listener
Oct 28, 2026
Merged

yhteoh merged 3 commits into
v1.0from
error_listener

Conversation

@yhteoh

@yhteoh yhteoh commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    feature

  • What is the current behavior? (You can also link to an open issue here)
    parsing and lexing uses default behavior from antlr, errors are not raised

  • What is the new behavior (if this is a feature change)?

  • Added AnalogParserErrorListener inheriting from both antlr.ErrorListener and oqd_compiler_infrastructure.DefaultErrorCollector
  • attach the AnalogParserErrorListener to AnalogLexer and AnalogParser in parse_analog for handling errors that occur in parsing and lexing
  • raise collected error when parsing is complete in parse_analog.
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    parse_analog now raises errors if any problems arise during lexing and parsing

  • Other information:

vishnu-m77 and others added 3 commits October 23, 2026 15:44
…e case where syntaxError is given None as argument `e` by adding GenericAnalogParserError, changed error_message_formatter to use always make use of custom message.
@yhteoh yhteoh changed the title feat: AnalogErrorListener for both parser and lexer uses DefaultError… feat: AnalogParserErrorListener for both parser and lexer uses DefaultError… Oct 27, 2026
@yhteoh yhteoh changed the title feat: AnalogParserErrorListener for both parser and lexer uses DefaultError… feat: AnalogParserErrorListener for both parser and lexer Oct 27, 2026
@yhteoh yhteoh added the enhancement New feature or request label Oct 27, 2026
@yhteoh
yhteoh marked this pull request as ready for review October 28, 2026 14:15
@yhteoh
yhteoh merged commit f89b91d into v1.0 Oct 28, 2026
2 of 12 checks passed
@yhteoh
yhteoh deleted the error_listener branch October 28, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants