-
-
Notifications
You must be signed in to change notification settings - Fork 35
Parse arr[end] differently from arr[var"end"] #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/parser.jl
Outdated
@@ -3627,6 +3627,14 @@ function parse_atom(ps::ParseState, check_identifiers=true, has_unary_prefix=fal | |||
elseif check_identifiers && is_closing_token(ps, leading_kind) | |||
# :(end) ==> (quote-: (error end)) | |||
bump(ps, error="invalid identifier") | |||
elseif ps.end_symbol && leading_kind in KSet"begin end" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a version check on the parse syntax, since JuliaSyntax itself is not tied to a Julia version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Assuming 1.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do 1.13 - we can change it later if we decide to backport.
I think the changes to So if you like we could merge this right away if you make sure the
Later you can make a separate PR if PkgEval deems the |
Thanks for the help!
Waiting on pkgeval before deciding whether to keep the Expr change. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #537 +/- ##
==========================================
- Coverage 96.18% 96.08% -0.10%
==========================================
Files 13 13
Lines 4032 4113 +81
==========================================
+ Hits 3878 3952 +74
- Misses 154 161 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes a small issue present in both parsers (see discussion at JuliaLang/julia#57269) due to treating
begin
/end
in indexing expressions as normal identifiers.This would be a breaking change that goes with PR JuliaLang/julia#57368, which makes the same change to the lisp parser, and changes lowering to expect
Expr(:end)
instead of a symbol.