Skip to content

More precise error for lexing errors - #265

Merged
Gbury merged 2 commits into
masterfrom
better_lexing_error
Jul 29, 2026
Merged

More precise error for lexing errors#265
Gbury merged 2 commits into
masterfrom
better_lexing_error

Conversation

@Gbury

@Gbury Gbury commented Jul 28, 2026

Copy link
Copy Markdown
Owner

When lexing of a quoted symbol in smt-lib failed, due to the structure of the lexer, the error was reported as an invalid cahracter on the pipe that started the quoted symbol, which was quite misleading (although technically correct). This is fixed in two ways:

  • change the parser so that the error can be raised on the invalid char inside of ther quoted symbol (possible in smt-lib because a pipe can only be the start of a quoted symbol)
  • the lexing error raised by lexer now carry the context of where the lexer was, allowing to specify e.g. that a character is invalid inside of a comment/string/quoted symbol

See e.g. the discussion in SMT-LIB/benchmark-submission#12

Gbury added 2 commits July 29, 2026 12:30
When lexing of a quoted symbol in smt-lib failed, due to the
structure of the lexer, the error was reported as an invalid cahracter
on the pipe that started the quoted symbol, which was quite misleading
(although technically correct). This is fixed in two ways:
- change the parser so that the error can be raised on the invalid char
  inside of ther quoted symbol (possible in smt-lib because a pipe can
  only be the start of a quoted symbol)
- the lexing error raised by lexer now carry the context of where the
  lexer was, allowing to specify e.g. that a character is invalid inside
  of a comment/string/quoted symbol
@Gbury
Gbury force-pushed the better_lexing_error branch from fc4c388 to 7debe8d Compare July 29, 2026 11:30
@Gbury
Gbury merged commit 278dfe9 into master Jul 29, 2026
16 checks passed
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