Skip to content
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

Meta.parse fails to parse with 2 or more trailing newlines #57345

Open
MichaelHatherly opened this issue Feb 10, 2025 · 1 comment
Open

Meta.parse fails to parse with 2 or more trailing newlines #57345

MichaelHatherly opened this issue Feb 10, 2025 · 1 comment
Labels
parser Language parsing and surface syntax
Milestone

Comments

@MichaelHatherly
Copy link
Member

This appears to be a regression in Meta.parse. On current stable release we have:

julia> VERSION
v"1.11.3"

julia> Meta.parse("1\n\n")
1

julia> Meta.parse("1\n")
1

On a recent nightly it throws when there is more than one newline:

julia> VERSION
v"1.13.0-DEV.26"

julia> Meta.parse("1\n\n")
ERROR: ParseError("extra token after end of expression")
Stacktrace:
 [1] parse(str::String; filename::String, raise::Bool, depwarn::Bool)
   @ Base.Meta ./meta.jl:283
 [2] parse(str::String)
   @ Base.Meta ./meta.jl:276
 [3] top-level scope
   @ REPL[17]:1

julia> Meta.parse("1\n")
1
@KristofferC KristofferC added this to the 1.12 milestone Feb 10, 2025
@KristofferC KristofferC added the parser Language parsing and surface syntax label Feb 10, 2025
@vtjnash
Copy link
Member

vtjnash commented Feb 18, 2025

This should probably move to JuliaSyntax.jl, but I am not sure how that interacts with trying to have things on the v1.12 milestone also for tracking purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

3 participants