JuliaLang / JuliaLang/JuliaSyntax.jl

Regression with semi-colon in comprehension before `for`

Open
#402 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
293
Forks
50
PR merge metrics
No merged PRs in 30d

Description

It's unclear to me whether the flisp behaviour is intended or desired, but JuliaSyntax does behave differently than flisp:
flisp:
```
julia> Meta.parse("[i; for i in 1:3]")
:([i for i = 1:3])

julia> Meta.parse("[i for i in 1:3]")
:([i for i = 1:3])
```
JuliaSyntax#main:
```
julia> JuliaSyntax.parse(Expr, "[i; for i in 1:3]")
ERROR: ParseError:
# Error @ line 1:17
[i; for i in 1:3]
# ╙ ── unexpected `]`
Stacktrace:
[1] _parse(rule::Symbol, need_eof::Bool, ::Type{…}, text::String, index::Int64; version::VersionNumber, ignore_trivia::Bool, filename::Nothing, first_line::Int64, ignore_errors::Bool, ignore_warnings::Bool, kws::@Kwargs{})
@ JuliaSyntax ~/.julia/dev/JuliaSyntax/src/parser_api.jl:93
[2] _parse (repeats 2 times)
@ JuliaSyntax ~/.julia/dev/JuliaSyntax/src/parser_api.jl:77 [inlined]
[3] parsestmt(::Type{Expr}, text::String)
@ JuliaSyntax ~/.julia/dev/JuliaSyntax/src/parser_api.jl:140
[4] parse(::Type, ::Vararg{Any}; kwargs::@Kwargs{})
@ JuliaSyntax ./deprecated.jl:116
[5] parse(::Type, ::Vararg{Any})
@ JuliaSyntax ./deprecated.jl:113
[6] top-level scope
@ REPL[28]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> JuliaSyntax.parse(Expr, "[i for i in 1:3]")
:([i for i = 1:3])
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.