JuliaSyntax: parse `typegroup` as identifier on older Julia versions (#61304)
On Julia versions < 1.14, `typegroup` is treated as an ordinary
identifier rather than a reserved keyword. This fixes parsing of code
like `let typegroup = 3 end` when targeting older versions.
We had not previously defined our syntax evolution policies for addition
for new keywords. My proposal, implemented in this PR is as follows:
- Where the old syntax parsed, keep providing the same parse result
- Where the new syntax would be a syntax error in the old syntax
version, attempt to parse as the new syntax (and then wrap it in the
version error). This provides better error messages and error recovery
when attempting to use new syntax in an old syntax version.
Implements post-commit review from
https://github.com/JuliaLang/julia/pull/60569#discussion_r2925201976
Co-authored-by: Keno Fischer <Keno@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>