# Anomalous "JuliaSyntax parser failed" error - julia 1.11.0-DEV

**URL:** <https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 29, 2024, 4:30am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382 "2024-06-29T04:30:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjiw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjiw/32/29944_2.png) [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Post date:** [June 29, 2024, 4:30am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/1 "2024-06-29T04:30:34Z")

</div>

Running `julia parsererr2.jl` (with parsererr2.jl as shown later) produces a proper error message\* about a misplaced bracket:

```julia
ERROR: LoadError: syntax: missing last argument in "w[4]:" range expression 
Stacktrace:
 [1] top-level scope
   @ ... /parsererr2.jl:10
in expression starting at ... /parsererr2.jl:10

```

\*Message shown with file path redacted

Here is the program:

```julia
module d6
mutable struct SE
    w ::String
    vb ::Int
    ve ::Int
end
vv(s) = 5
function main()
    wi=["aaaa", "bbbb",]
    wo = [SE(w, vv(w), vv(w[4]:end)) for w in sort(unique(wi))]
end
main()
end # module

```

Note, `julia --version` shows `julia version 1.9.2` and `julia-latest --version` shows `julia version 1.11.0-DEV` on my ubuntu.22.04 linux system.

Running `julia-latest parsererr2.jl` with the `wo =` line split via a newline before `for` results in an error message with mostly the same content as julia version 1.9.2’s message (with 2 context lines and a header line added). Without that newline, `julia-latest parsererr2.jl` produces an anomalous error message which includes an exception report and quotes the whole program:

```julia
┌ Error: JuliaSyntax parser failed — falling back to flisp!
│ exception = (BoundsError(Any[], (1,)), Union{Ptr{Nothing}, Base.InterpreterIP}[Ptr{Nothing} @0x00007ff209c3b5ec, Ptr{Nothing} @0x00007ff1f7d21d17, Ptr{Nothing} @0x00007ff1f73ff479, Ptr{Nothing} @0x00007ff1f73fefa4, Ptr{Nothing} @0x00007ff1f73fefa4, Ptr{Nothing} @0x00007ff1f774659f, Ptr{Nothing} @0x00007ff1f83a3e50, Ptr{Nothing} @0x00007ff1f7682b5c, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc6329, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f7439d43, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f763b2ca, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f7ab5dcd, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f8143201, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f787d243, Ptr{Nothing} @0x00007ff1f7c075d6, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f7ad4723, Ptr{Nothing} @0x00007ff1f789abcd, Ptr{Nothing} @0x00007ff1f7df648a, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f7ca64e5, Ptr{Nothing} @0x00007ff1f7c98972, Ptr{Nothing} @0x00007ff1f820ed83, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209c24012, Ptr{Nothing} @0x00007ff209c24aee, Ptr{Nothing} @0x0000000000401088, Ptr{Nothing} @0x00007ff20a79bd8f, Ptr{Nothing} @0x00007ff20a79be3f, Ptr{Nothing} @0x00000000004010b8])
│ offset = 0
│ code = module d6
mutable struct SE
    w ::String
    vb ::Int
    ve ::Int
end
vv(s) = 5
function main()
    wi=["aaaa", "bbbb",]
    wo = [SE(w, vv(w), vv(w[4]:end)) for w in sort(unique(wi))]
end
main()
end # module

└ @ Base.JuliaSyntax /cache/build/default-amdci4-1/julialang/julia-master/base/JuliaSyntax/src/hooks.jl:258
ERROR: LoadError: syntax: missing last argument in "w[4]:" range expression 
Stacktrace:
 [1] top-level scope
   @ ... /parsererr2.jl:10
in expression starting at ... /parsererr2.jl:10

```

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [June 29, 2024, 5:24am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/2 "2024-06-29T05:24:50Z")

</div>

you likely meant to write `w[4:end]` instead of `w[4]:end`

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [June 29, 2024, 5:34am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/3 "2024-06-29T05:34:30Z")

</div>

Please report the bug to [Issues · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues)

---

<div class="post-metadata">

**Author:** ![jjiw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjiw/32/29944_2.png) [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Post date:** [June 29, 2024, 4:22pm UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/4 "2024-06-29T16:22:15Z")

</div>

Yes, of course. The post is about julia 1.11.0-DEV error handling vs julia 1.9.2.

---

<div class="post-metadata">

**Author:** ![jjiw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjiw/32/29944_2.png) [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Post date:** [June 29, 2024, 4:41pm UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/5 "2024-06-29T16:41:34Z")

</div>

nsajko, I set up to report this there, but didn’t do so. A few minutes ago I installed Julia Version 1.12.0-DEV.800 via `jill install latest`, with the plan of reporting the error against a more-up-to-date version. However, unlike Julia 1.11.0-DEV.715, Julia 1.12.0-DEV.800 handles the error properly, as below.

```julia
ERROR: LoadError: ParseError:
# Error @ ... /parsererr2.jl:10:32
    wi=["aaaa", "bbbb",]
    wo = [SE(w, vv(w), vv(w[4]:end)) for w in sort(unique(wi))]
# └ ── missing last argument in range expression
Stacktrace:
 [1] top-level scope
   @ ... /parsererr2.jl:10
 [2] include
   @ ./Base.jl:580 [inlined]
 [3] exec_options(opts::Base.JLOptions)
   @ Base ./client.jl:324
 [4] _start()
   @ Base ./client.jl:532
in expression starting at ... /parsererr2.jl:10

```

versioninfo() for 1.11.0 and 1.12.0 on my system:

```julia
Julia Version 1.11.0-DEV.715
Commit abd00d09ce3 (2023-10-24 02:31 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores

Julia Version 1.12.0-DEV.800
Commit 334e4d9f5d5 (2024-06-28 15:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-17.0.6 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

```

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [June 29, 2024, 8:36pm UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/6 "2024-06-29T20:36:29Z")

</div>

It should probably still be reported, while noting the status on v1.10 vs v1.11-dev vs nightly.

---

<div class="post-metadata">

**Author:** ![jjiw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjiw/32/29944_2.png) [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Post date:** [July 1, 2024, 7:25am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382/7 "2024-07-01T07:25:14Z")

</div>

nsajko, I reported the problem via [Anomalous “JuliaSyntax parser failed” error - julia 1.11.0-DEV.715 · Issue #54989 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/54989)
