Skip to content

solve-engine 1.1.1

Choose a tag to compare

@LiamRiddell LiamRiddell released this 23 Aug 22:26
· 32 commits to main since this release
b25964e

A patch release: a line of only backslashes, or any run of characters the lexer discards, no longer evaluates to 0.

The bug

\, \\ and \\\\ showed a result of 0 in the notepad and the playground, a number on screen for a line that holds no expression, where a blank line, a heading and a prose line all correctly showed nothing.

\           was 0, now no result
\\          was 0, now no result
\\\\        was 0, now no result

The cause

The lexer discards an unknown ASCII character, a backslash falls through to the same skip path as whitespace, so a line built only from them tokenises to an empty token stream. The line was still classified as an expression and evaluated, and the engine reports an empty token stream as the number 0.

The fix

One change, at the shared classifier: a line whose every character is discarded by the tokeniser (ASCII whitespace or a skip character) is now classified as empty, the same as a blank line. That single classification is read by the batch parse, the incremental evaluator, and the playground's prose gate, so every surface skips such a line rather than answering 0.

A backslash next to real content is unchanged: \1 is still 1 (the backslash is skipped), and 1 \ 2 still errors on the trailing 2. A non-ASCII code point stays real content (it lexes as an identifier), so accented or CJK text is untouched.

Verification

  • A regression spec (11 cases) covers the classification, the document result, and the boundary cases (\1, 1 \ 2, a blank line, a real expression).
  • 7,694 tests across 336 suites, no failures.
  • npm run verify green, and the publish itself runs assert-release-tag, verify and test:consumer against the packed tarball before anything reaches the registry.