Skip to content

Anomalous “JuliaSyntax parser failed” error - julia 1.11.0-DEV.715 #54989

Open
@ghjwp7

Description

I posted at https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382 regarding a parsing problem with Julia Version 1.11.0-DEV.715 Commit abd00d0 (2023-10-24 02:31 UTC) and got advice to post here (github JuliaLang/julia/issues).

Note, the problem does not occur with other versions than 1.11.0-DEV.715 that I've tried, including Julia Version 1.10.4 48d4fd4 2024-06-04; 1.11.0-beta2 edb3c92 2024-05-29; 1.11.0-rc1 3a35aec 2024-06-25; and 1.12.0-DEV.800 334e4d9 2024-06-28. At the moment I don't have 1.11.0-DEV.715 installed and haven't figured out how to find it or how to install it (if I find it) using jill without jill overwriting 1.11.0-rc1.

Contents here: Part 1: Problem description. Part 2: Program text. Part 3: Anomalous error text, from 1.11.0-DEV.715. Part 4: "Correct" error text, from 1.12.0-DEV.800. Part 5: versioninfo() for 1.11.0-DEV.715 and 1.12.0-DEV.800 on my system

Part 1. Problem description: Given the program shown next, with the second line of main() as shown, Julia Version 1.11.0-DEV.715 anomalously throws an exception after a message, Error: JuliaSyntax parser failed — falling back to flisp!, and before showing a message about the obviously misplaced bracket. See message in Part 3 (shown with file path redacted). Note, if a newline is added before for in the problem line, 1.11.0-DEV.715 no longer throws the anomalous exception.

Part 2: Program text.

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

Part 3: Anomalous error text, from 1.11.0-DEV.715.

┌ 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

Part 4: "Correct" error text, from 1.12.0-DEV.800.

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

Part 5: versioninfo() for 1.11.0-DEV.715 and 1.12.0-DEV.800:

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesBetter, more actionable error messagesparserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions