JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
267 stars 32 forks source link

JuliaSyntax parser failed when running Documenter on Julia master #351

Closed mkitti closed 8 months ago

mkitti commented 10 months ago

When trying to run doc/make.jl when developing Julia I go tthe following error reporting JuliaSyntax parser failed -- failling back to flisp!

$ ../usr/bin/julia --project=. make.jl
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.9.0-DEV). Unexpected behavior may occur.
└ @ ~/src/julia/doc/Manifest.toml:0
[ Info: SetupBuildDirectory: setting up build directory.
┌ Error: JuliaSyntax parser failed — falling back to flisp!
│   exception =
│    BoundsError: attempt to access empty SubString{String} at index [0]
│    Stacktrace:
│      [1] checkbounds(s::SubString{String}, I::Int64)
│        @ Base ./strings/basic.jl:216 [inlined]
│      [2] getindex(s::SubString{String}, i::Int64)
│        @ Base ./strings/substring.jl:91
│      [3] getindex(source::Base.JuliaSyntax.SourceFile, i::Int64)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/source_files.jl:120
│      [4] highlight(io::IOBuffer, source::Base.JuliaSyntax.SourceFile, range::UnitRange{…}; color::Tuple{…}, context_lines_before::Int64, context_lines_inner::Int64, context_lines_after::Int64, note::String, notecolor::Symbol)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/source_files.jl:222
│      [5] show_diagnostic(io::IOBuffer, diagnostic::Base.JuliaSyntax.Diagnostic, source::Base.JuliaSyntax.SourceFile)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/diagnostics.jl:76
│      [6] show_diagnostics(io::IOBuffer, diagnostics::Vector{Base.JuliaSyntax.Diagnostic}, source::Base.JuliaSyntax.SourceFile)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/diagnostics.jl:86
│      [7] showerror(io::IOBuffer, err::Base.JuliaSyntax.ParseError)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/parser_api.jl:20
│      [8] sprint(f::Function, args::Base.JuliaSyntax.ParseError; context::Nothing, sizehint::Int64)
│        @ Base ./strings/io.jl:114
│      [9] sprint(f::typeof(showerror), args::Base.JuliaSyntax.ParseError)
│        @ Base ./strings/io.jl:107 [inlined]
│     [10] core_parser_hook(code::String, filename::String, lineno::Int64, offset::Int64, options::Symbol)
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/hooks.jl:184
│     [11] invoke_in_world(::UInt64, ::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
│        @ Base ./essentials.jl:901
│     [12] invoke_in_world(::UInt64, ::Any, ::Any, ::Vararg{Any})
│        @ Base ./essentials.jl:898
│     [13] (::Base.JuliaSyntax.var"#invoke_fixedworld#120"{Base.JuliaSyntax.var"#invoke_fixedworld#117#121"{typeof(Base.JuliaSyntax.core_parser_hook), UInt64}})(::String, ::Vararg{Any}; kws::@Kwargs{})
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/hooks.jl:118
│     [14] (::Base.JuliaSyntax.var"#invoke_fixedworld#120"{Base.JuliaSyntax.var"#invoke_fixedworld#117#121"{typeof(Base.JuliaSyntax.core_parser_hook), UInt64}})(::String, ::Vararg{Any})
│        @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/hooks.jl:117
│     [15] _parse_string(text::String, filename::String, lineno::Int64, index::Int64, options::Symbol)
│        @ Base.Meta ./meta.jl:200
│     [16] parse(str::String, pos::Int64; filename::String, greedy::Bool, raise::Bool, depwarn::Bool)
│        @ Base.Meta ./meta.jl:238 [inlined]
│     [17] _parse(stream::IOBuffer; greedy::Bool, raise::Bool)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Julia/interp.jl:5
│     [18] interpinner(stream::IOBuffer, greedy::Bool)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Julia/interp.jl:14
│     [19] interpinner(stream::IOBuffer)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Julia/interp.jl:11 [inlined]
│     [20] (::Markdown.var"#91#92"{IOBuffer})()
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Julia/interp.jl:27 [inlined]
│     [21] withstream(f::Markdown.var"#91#92"{IOBuffer}, stream::IOBuffer)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/util.jl:113 [inlined]
│     [22] interp(stream::IOBuffer, md::Markdown.MD)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Julia/interp.jl:26
│     [23] parseinline(stream::IOBuffer, md::Markdown.MD, parsers::Vector{Function})
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:47
│     [24] parseinline(stream::IOBuffer, md::Markdown.MD, config::Markdown.Config)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:57
│     [25] parseinline(s::IOBuffer, md::Markdown.MD)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:75 [inlined]
│     [26] paragraph(stream::IOBuffer, md::Markdown.MD)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Common/block.jl:34
│     [27] parse(stream::IOBuffer, block::Markdown.MD, config::Markdown.Config; breaking::Bool)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:83
│     [28] parse(stream::IOBuffer, block::Markdown.MD, config::Markdown.Config)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:79 [inlined]
│     [29] parse(stream::IOBuffer; flavor::Markdown.Config)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/parse/parse.jl:94
│     [30] parse(markdown::String; flavor::Markdown.Config)
│        @ Markdown ~/src/julia/usr/share/julia/stdlib/v1.11/Markdown/src/Markdown.jl:31 [inlined]
│     [31] Documenter.Documents.Page(source::String, build::String, workdir::String)
│        @ Documenter.Documents ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Documents.jl:58
│     [32] addpage!(doc::Documenter.Documents.Document, src::String, dst::String, wd::String)
│        @ Documenter.Documents ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Documents.jl:397 [inlined]
│     [33] runner(::Type{Documenter.Builder.SetupBuildDirectory}, doc::Documenter.Documents.Document)
│        @ Documenter.Builder ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Builder.jl:131
│     [34] dispatch(::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Documents.Document)
│        @ Documenter.Utilities.Selectors ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Utilities/Selectors.jl:170
│     [35] (::Documenter.var"#2#3"{Documenter.Documents.Document})()
│        @ Documenter ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Documenter.jl:273 [inlined]
│     [36] cd(f::Documenter.var"#2#3"{Documenter.Documents.Document}, dir::String)
│        @ Base.Filesystem ./file.jl:112
│     [37] makedocs(; debug::Bool, format::Documenter.Writers.HTMLWriter.HTML, kwargs::@Kwargs{…})
│        @ Documenter ~/src/julia/doc/deps/packages/Documenter/yf96B/src/Documenter.jl:272
│     [38] top-level scope
│        @ ~/src/julia/doc/make.jl:296
│     [39] include(mod::Module, _path::String)
│        @ Base ./Base.jl:489
│     [40] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:318
│     [41] _start()
│        @ Base ./client.jl:552
│    Some type information was truncated. Use `show(err)` to see complete types.
│   offset = 0
│   code = ")' may trigger package precompilation):"
└ @ Base.JuliaSyntax ~/src/julia/base/JuliaSyntax/src/hooks.jl:258
c42f commented 8 months ago

Possible duplicate of #352. Though will need checking

c42f commented 8 months ago

Looks like this is sorted out with the latest dev version.