Skip to content

v0.20.9

Choose a tag to compare

@odvcencio odvcencio released this 02 Jul 21:20

Patch release recovering C# large-namespace method/type declarations and the Swift ternary/conditional operator, both via post-parse source recovery passes, plus a CI stability fix.

Fixed

  • C#: Large C# files whose class body is shredded by a cumulative GLR failure (e.g. Newtonsoft.Json's JsonTextReader.cs / JsonReader.cs) now recover their method_declaration nodes instead of yielding only a comment-filled namespace shell. Namespace recovery now falls back, when the child-based pass surfaces no method, to a per-member bounded source reconstruction. JsonTextReader.cs now recovers 68 methods (was 0) and JsonReader.cs 41 (was 0). Fixes #136 (#138). Thanks @richardwooding for the report, repro, and the fix.
  • Swift: the ternary/conditional operator (cond ? a : b) now recovers instead of dropping ? a : b into an ERROR node in every position — previously any function containing a ternary lost its whole parse. A post-parse recovery pass reconstructs the ternary_expression node by reparsing the source with the ? if_true : if_false tail blanked so the condition parses in place, then splicing a synthesised node back in with the upstream condition/if_true/if_false layout. The rewrite is accepted only when the result is error-free and byte-faithful, so non-ternary code is never affected. Fixes #135 (#137). Thanks @richardwooding for the report and the fix.

CI

  • TestCSharpLargeShreddedNamespaceRecoversMethods now skips under go test -race: the per-member bounded recovery reparses each class member as its own small GLR parse, which normally finishes well inside the parser's timeout budget, but race-detector instrumentation slows the same work enough to trip the parser's internal wall-clock timeout. Non-race coverage keeps the full recovery assertions.

Looking ahead

A root-cause fix for Swift's grammar (native ternary parsing via a regenerated grammar blob/table, rather than a post-parse recovery pass) is in progress on the parser-generalization campaign branch and will ship in a future release.

Full Changelog: v0.20.8...v0.20.9