Skip to content

grammar: v0.2.0 — all three documented limitations now parse - #9

Merged
tannevaled merged 1 commit into
mainfrom
docs/v0.2.0-refresh
Sep 23, 2026
Merged

tannevaled merged 1 commit into
mainfrom
docs/v0.2.0-refresh

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The parser shipped v0.2.0 on 2026-09-21 with fourteen grammar fixes. This site did not mention it — nor any parser version, nor any release date. Worse, all three entries under "Known limitations" are now false, and one of them has been wrong for three months.

What I verified

I built a probe against github.com/go-ruby-parser/parser v0.2.0 and ran each documented limitation through parser.Parse, with ruby -c (MRI 4.0.5) as the oracle:

paren-less cmd kwargs  foo a: 1    PARSES
paren-less cmd splat   foo *a      PARSES
paren-less cmd block   foo a: 1 do end   PARSES
splat block param      { |*a| }    PARSES
default block param    { |a = 1| } PARSES
empty block params     { || }      PARSES
find-pattern Class(a)              PARSES
find-pattern Class[a]              PARSES

Every one. The splat-block-param entry in particular had been wrong since 2026-06-22 — upstream corrected its own README about eleven hours after this page was last edited, and the page never caught up.

What is actually left

A 41-construct differential sweep against MRI 4.0.5 (parser.Parse vs ruby -c, same sources): one disagreement, 0 over-permissive.

  • BEGIN { } / END { } blocks do not parse. MRI accepts them.

Everything else probed parses: __END__/DATA, flip-flop, redo, method-level rescue/ensure, heredoc with a method call, two heredocs on one line, named-capture assignment, $-0, magic encoding comments, p(x:), def a(&) = b(&), def a(...) = b(...), one-line =>/in, a&.b = 1, defined?(yield), **nil, alias $new $old, 2r/3i, keywords as method names, and the rest.

I have also noted the four language/ spec files that parse but stop later in go-embedded-ruby's own compiler (for_spec, block_spec, defined_spec, variables_spec) — consumer-side work, not a parser gap, and the page now says so rather than leaving a reader to infer a parser limitation.

docs/grammar.md

The limitations section is replaced by "What v0.2.0 added" — the fourteen gaps, with v0.2.0's own measure: every one of the 68 files in the pinned ruby/spec language/ corpus now parses, thirteen of which had not parsed at all before. That last point is the one worth having on a docs page: those files were contributing nothing to either column of any conformance measurement — not failing, invisible.

It also keeps the two silent mis-parses among the fourteen, because they are worse than refusals — nothing diagnoses them:

o.s (:a){ 1 }          # the brace block bound to :a, not to the call
case [0,1,2,3]
in [0, 1, ]            # the trailing comma was dropped, so a partial pattern
  :partial             # became an exact one and this fell through to else
else
  :exact
end

docs/index.md

  • names v0.2.0 (2026-09-21) as the current release and versions the go get line (it had no version suffix);
  • the coverage claim said "100% coverage enforced in CI across the six 64-bit targets". Per the parser's own ci.yml the gate is on the three OS lanes (ubuntu, macOS, windows); the six 64-bit targets — amd64/arm64 natively, riscv64/loong64/ppc64le/s390x under QEMU — plus js/wasm and wasip1/wasm run the suite without the coverage gate. Both facts are now stated, correctly attributed.

.github/workflows/docs.yml

mike deploy --push --update-aliases **0.1** latest. With v0.2.0 tagged, the live version dropdown was labelling post-v0.2.0 docs as 0.1 docs. Bumped to 0.2, and the comment above it with it.

Worth knowing, not fixed here

The repo has zero GitHub Releases — gh release list --repo go-ruby-parser/parser is empty and gh api …/releases returns []. v0.2.0 exists only as a git tag. So there are no release notes for a docs page to link to, and I have linked the tag tree (/tree/v0.2.0) rather than /releases/tag/v0.2.0, which renders an empty page. Publishing the releases, and wiring mike's tag-driven versioning (its own comment says "tag-driven versions can be added later", never done), are both worth doing — but they are repo-process changes, not doc corrections, so they are not in this PR.

Left alone deliberately

The upstream Performance section (615 harvested snippets, 1.5×/2.1× vs RubyVM::AbstractSyntaxTree.parse, ~6× vs Ripper.sexp, 24–30× on the lexer) is absent from this site entirely. That is a gap rather than a wrong claim, and I could not reproduce those benchmarks in this pass, so I did not import numbers I have not measured.

Also left: the Ruby 4.0 / MRI 4.0.5 / CGO=0 / Go 1.26.4+ claims, which I checked against the parser repo and which still hold. And requirements.txt's pins (mkdocs-material==9.7.7, mike==2.2.0) — dependency hygiene, not doc drift.

No merge. No screenshots.

🤖 Generated with Claude Code

Every one of the three entries under "Known limitations" is false as of v0.2.0
(2026-09-21). Verified against v0.2.0 with parser.Parse, MRI 4.0.5 `ruby -c` as
the oracle:

  paren-less cmd kwargs  foo a: 1   PARSES
  splat block param      { |*a| }   PARSES
  default block param    { |a = 1| } PARSES
  empty block params     { || }     PARSES
  find-pattern Class(a)             PARSES

The splat-block-param entry had been wrong for three months: upstream corrected
its own README about eleven hours after this page was last edited.

Replaced with what v0.2.0 added (the fourteen gaps, including the two silent
MIS-PARSES, which are worse than refusals because nothing diagnoses them), and
with the limitation that is actually left. From a 41-construct differential
sweep against MRI 4.0.5, one disagreement and 0 over-permissive:

  BEGIN { } / END { } blocks do not parse.

Also noted: four language spec files parse but stop in go-embedded-ruby's own
compiler, which is consumer-side work and not a parser gap.

index.md: names v0.2.0 as the current release and versions the `go get` line --
neither site mentioned any parser version at all. The coverage claim said "100%
coverage enforced in CI across the six 64-bit targets"; per the parser's ci.yml
the gate is on the three OS lanes, and the six arches (plus js/wasm and
wasip1/wasm) run the suite without the coverage gate.

docs.yml: mike published the site as version "0.1". With v0.2.0 tagged that
labelled post-v0.2.0 docs as 0.1 docs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d780ead into main Sep 23, 2026
2 checks passed
@tannevaled
tannevaled deleted the docs/v0.2.0-refresh branch September 23, 2026 17:51
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