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

Possible to get better error message on syntax errors? #421

Closed
KristofferC opened this issue Feb 12, 2020 · 3 comments · Fixed by #424
Closed

Possible to get better error message on syntax errors? #421

KristofferC opened this issue Feb 12, 2020 · 3 comments · Fixed by #424

Comments

@KristofferC
Copy link
Collaborator

This is what I get from Revise on a syntax error:

┌ Error: Failed to revise /home/kc/JuliaPkgs/SIMD.jl/src/simdvec.jl
│   exception =
│    LoadError: "missing comma or } in argument list"
│    Stacktrace:
│     [1] parse_source!(::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}, ::String, ::String, ::Module) at /home/kc/.julia/packages/Revise/S7mrl/src/parsing.jl:45
│    in expression starting at /home/kc/JuliaPkgs/SIMD.jl/src/simdvec.jl:3

Restarting Julia and trying to load the package gives:

ERROR: LoadError: LoadError: syntax: missing comma or } in argument list
Stacktrace:
 [1] top-level scope at /home/kc/JuliaPkgs/SIMD.jl/src/simdvec.jl:256
 [2] include(::Module, ::String) at ./Base.jl:377
 [3] include(::String) at /home/kc/JuliaPkgs/SIMD.jl/src/SIMD.jl:1
 [4] top-level scope at /home/kc/JuliaPkgs/SIMD.jl/src/SIMD.jl:20
 [5] include(::Module, ::String) at ./Base.jl:377
 [6] top-level scope at none:2
 [7] eval at ./boot.jl:331 [inlined]
 [8] eval(::Expr) at ./client.jl:449
 [9] top-level scope at ./none:3
in expression starting at /home/kc/JuliaPkgs/SIMD.jl/src/simdvec.jl:256
in expression starting at /home/kc/JuliaPkgs/SIMD.jl/src/SIMD.jl:20

What I am interested in is of course /home/kc/JuliaPkgs/SIMD.jl/src/simdvec.jl:256. It would be nice if that information could somehow be made available.

@timholy
Copy link
Owner

timholy commented Feb 12, 2020

Do you have a reproducer? I almost always get the line number.

@KristofferC
Copy link
Collaborator Author

KristofferC commented Feb 13, 2020

Sure, in the branch at eschnett/SIMD.jl#63, I go into simdvec.jl and on line 137 I write function then I trigger a Revise and get (sorry about unicode mess):

julia> Revise.revise()
‚îå Error: Failed to revise /Users/kristoffercarlsson/Documents/JuliaPkgs/SIMD.jl/src/simdvec.jl
│   exception =
│    LoadError: "unexpected \"=\""
│    Stacktrace:
│     [1] parse_source!(::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}, ::String, ::String, ::Module) at /Users/kristoffercarlsson/.julia/packages/Revise/S7mrl/src/parsing.jl:45
│    in expression starting at /Users/kristoffercarlsson/Documents/JuliaPkgs/SIMD.jl/src/simdvec.jl:3
‚îî @ Revise ~/.julia/packages/Revise/S7mrl/src/Revise.jl:590
‚îå Warning: Due to a previously reported error, the running code does not match saved version for the following files:
│
│   /Users/kristoffercarlsson/Documents/JuliaPkgs/SIMD.jl/src/simdvec.jl
│
│ Use Revise.errors() to report errors again.
‚îî @ Revise ~/.julia/packages/Revise/S7mrl/src/Revise.jl:639

@timholy
Copy link
Owner

timholy commented Feb 17, 2020

Thanks for reporting! If you get any more please let me know.

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

Successfully merging a pull request may close this issue.

2 participants