Skip to content

Conversation

@c42f
Copy link
Member

@c42f c42f commented Nov 23, 2023

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

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
@c42f c42f mentioned this pull request Nov 23, 2023
10 tasks
@codecov
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c42f c42f merged commit acb609d into main Nov 23, 2023
@c42f c42f deleted the caf/fix-cmd-lexing-vs-parsing branch November 23, 2023 11:03
c42f added a commit that referenced this pull request Dec 6, 2023
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
c42f added a commit to JuliaLang/julia that referenced this pull request Oct 17, 2025
…uliaSyntax.jl#394)

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 JuliaLang/JuliaSyntax.jl#25
topolarity pushed a commit to JuliaLang/julia that referenced this pull request Nov 14, 2025
…uliaSyntax.jl#394)

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 JuliaLang/JuliaSyntax.jl#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant