v0.20.9
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 theirmethod_declarationnodes 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.csnow recovers 68 methods (was 0) andJsonReader.cs41 (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 : binto anERRORnode in every position — previously any function containing a ternary lost its whole parse. A post-parse recovery pass reconstructs theternary_expressionnode by reparsing the source with the? if_true : if_falsetail blanked so the condition parses in place, then splicing a synthesised node back in with the upstreamcondition/if_true/if_falselayout. 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
TestCSharpLargeShreddedNamespaceRecoversMethodsnow skips undergo 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