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

Multiline comment parsing error on 1.11-rc3 #55792

Open
j-fu opened this issue Sep 17, 2024 · 1 comment
Open

Multiline comment parsing error on 1.11-rc3 #55792

j-fu opened this issue Sep 17, 2024 · 1 comment

Comments

@j-fu
Copy link

j-fu commented Sep 17, 2024

When loaded via using from a directory on LOAD_PATH, the following code
works on Julia 1.10.5, but fails on 1.11-rc3 as well on nightly (02549d5):

#=
Demonstrate a parsing error when 
using multiline comments on Julia 1.11-rc3
^^^^^
   This `using` word makes 1.11-rc3 believe that 
there is a `using` statement before the module
declaration when the code is loaded from a directory
on LOAD_PATH
=#
module UsingError
main()=println("Hi there!")
end

This is the error message:

julia> using UsingError
[ Info: Precompiling UsingError [top-level]
ERROR: LoadError: Package UsingError [top-level] source file /home/fuhrmann/Wias/work/julia/dev/VoronoiFVM/examples/UsingError.jl has a using/import before a module declaration.
Stacktrace:
[1] check_src_module_wrap(pkg::Base.PkgId, srcpath::String)
@ Base ./loading.jl:2718
[2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base ./loading.jl:2733
[3] top-level scope
@ stdin:4
in expression starting at stdin:4
ERROR: Failed to precompile UsingError [top-level] to "/home/fuhrmann/.julia/compiled/v1.11/jl_RH516U".
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{…})
@ Base ./loading.jl:3036
[3] (::Base.var"#1080#1081"{Base.PkgId})()
...
@KristofferC
Copy link
Sponsor Member

#51635

"How do you parse Julia with regexes?"

j-fu added a commit to j-fu/VoronoiFVM.jl that referenced this issue Sep 17, 2024
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

2 participants