Repository navigation
Parser: tolerant mode, source ranges and written names (LSP foundation, phase 1) - #481
Merged
Merged
Conversation
…ct-invariance corpus
…se, narrower sibling exemption
…attributes in RangeCheck
…gedSpan and RangedToken
…ery balances open braces, Throwable entry kept
…ols, document recovery and the nesting cap
…cess on a non-ArrayAccess object (#479)
…ent; goto-label tail is complete; rebased template golden
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase 1 of the LSP foundation (epic #456): the parser becomes usable by editor tooling without changing what the compiler sees. One parser, two modes; strict stays byte-identical.
Parser::parseTolerant(source, file, ranges, names): ParseResult— never throws, never loops, returns aProgramplus every syntax error (cap 100, nesting cap 1000 with a single error).ErrorExpr), statement/member boundary sync with brace/paren/bracket balancing (ErrorStmt).ParseErrorend fields,RangedSpan/RangedToken(ranges exist only in ranges mode, so strict memory stays flat), range invariant checker.NameReftable (written spelling, resolved FQN, kind).dump-ast --tolerant/--ranges/--names/--check-ranges/--check-names.analyzenow reports every syntax error per file.tests/parser/(goldens, truncation + garbage fuzz, strict-invariance, memory check), run intools/docker/gate.sh.dump-astchange, 57 enum files).Not in scope
Analyzer walkers are not Error-aware yet, no
ErrorMember, interpolation parts share the whole-string range, no hoisted-anon-class marker — Phase 2 (#453).Evidence
tests/parser/run.sh111/111; fuzz clean; strict-invariance OK over 2816 files; range/name checks 0 violations over 5760 runs.tests/analyze: same 4 failures as main.Gates owed
Full AOT suite,
tools/difftest.sh,tools/selfhost_fixpoint.sh, Linux gate (nesting cap 1000 was measured on macOS only).Found on the way: #478, #479 (repros included).
Fixes #450 Fixes #451 Fixes #452