Skip to content

feat: parse ISC with parsanol natively - #780

Merged
ronaldtse merged 1 commit into
mainfrom
feat/parsanol-grammar
Sep 30, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
feat/parsanol-grammar

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Drops parslet for the native Parsanol API — Parsanol::Parser, include Parsanol in the grammar concerns, Parsanol::Transform, Parsanol::ParseFailed — not the Parsanol::Parslet compat shim.

Two tree-shape optimizations the old engine could not reward:

  • quoted strings capture escape-free stretches as one run slice instead of a per-char hash — a large map went from ~700k capture nodes to a few thousand
  • the DocumentBuilder decodes {string:} fragments directly instead of routing every quoted string through Transform pattern matching

acadsin parse+build: ~24 s → ~15 s (parse 4.9 s, build 10 s). All 129 ISC/corpus/listing specs pass unchanged; full suite 1149 examples, 0 failures with CI-equivalent flags.

Groundwork for the .parg step: the grammar source moves to a portable artifact next, shared with parsanol npm.

Dependency change

parslet (~> 2.0) → parsanol (~> 1.3). Prebuilt platform gems cover the CI matrix (arm64/x86_64 darwin, linux, mingw; Ruby >= 3.2 floor).

Drop the parslet dependency for the native Parsanol API (Parsanol::Parser,
include Parsanol in the grammar concerns, Parsanol::Transform,
Parsanol::ParseFailed) — not the Parsanol::Parslet compat shim.

Two tree-shape optimizations that the old engine could not reward:

- quoted strings capture escape-free stretches as one run slice instead
  of a per-char hash (a large map went from ~700k capture nodes to a
  few thousand)
- the DocumentBuilder decodes {string:} fragments directly instead of
  routing every quoted string through Transform pattern matching

acadsin parse+build: ~24 s -> ~15 s (parse 4.9 s, build 10 s). All 129
ISC/corpus/listing specs pass unchanged.
@ronaldtse
ronaldtse merged commit e8ffa8e into main Sep 30, 2026
4 of 10 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