JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
272 stars 35 forks source link

Fix crashes due to lexing ambiguity of string delimiters #394

Closed c42f closed 10 months ago

c42f commented 10 months ago

There are some lexing ambituities in primes vs cmd delimiters. We break these with a simple rule in the lexer but there's edge cases of invalid or extremely strange syntax where this can be inconsistent with the parser. The following were some such cases which caused an assertion error in the parser.

"var\"#\"``\$"
"x in'``\$"

This change avoids crashing in those cases, emitting an error instead.

See also #25

Fix part of #380

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (5769755) 96.58% compared to head (8e4ecb1) 96.58%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #394 +/- ## ======================================= Coverage 96.58% 96.58% ======================================= Files 14 14 Lines 4187 4193 +6 ======================================= + Hits 4044 4050 +6 Misses 143 143 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.