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

ParseError when typing multi-line input with comment #519

Open
benlorenz opened this issue Dec 12, 2024 · 0 comments
Open

ParseError when typing multi-line input with comment #519

benlorenz opened this issue Dec 12, 2024 · 0 comments

Comments

@benlorenz
Copy link

Since the backport of #397 to release-0.4 (julia nightly since JuliaLang/julia#56110) and also on main, I cannot enter multi-line input which contains comments. Once I press return after the comment it directly aborts with a ParseError instead of letting me continue the input in the next line:

julia> function bla()
       a=1
       b=2 #a comment
ERROR: ParseError:
# Error @ REPL[2]:3:4
a=1
b=2 #a comment
#  └ ── Expected `end`
Stacktrace:
 [1] top-level scope
   @ REPL:1

The same happens when entering an array in multiple lines:

julia> arr = [
       1,
       2,
       3, # i like this number
ERROR: ParseError:
# Error @ REPL[3]:4:3
2,
3, # i like this number
# └ ── Expected `]` or `,`
Stacktrace:
 [1] top-level scope
   @ REPL:1

Note that this applies only to entering this manually line by line, pasting multi-line strings with comments works fine.

With previous julia nightly (or JuliaSyntax.jl) versions the error appears only on the second consecutive empty line:

julia> arr = [
       1,
       2,
       3, # i like this number
       
       
ERROR: ParseError:
# Error @ REPL[33]:5:2
3, # i like this number

#└ ── Expected `]`
Stacktrace:
 [1] top-level scope
   @ REPL:1
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

No branches or pull requests

1 participant