-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
VSCode, OhMyREPL and JuliaSyntax. strange error in REPL #236
Comments
|
Yep this is/was definitely a bug in the parser, thanks for the report! It's something to do with validating macro names (surprisingly awkward to do), but it's quite hard to tell without the source string you were typing. In 0.3.3 there's still a couple of ways to crash things with really weird macro names, but I've just fixed those up in development now with #222 and related changes. For example, the following reproduces something very similar to your stacktrace in 0.3.3, but not in 0.4-dev: julia> JuliaSyntax.parse(JuliaSyntax.SyntaxNode, "@([x])")
ERROR: InexactError: trunc(UInt32, -1)
Stacktrace:
[1] throw_inexacterror(f::Symbol, #unused#::Type{UInt32}, val::Int64)
@ Core ./boot.jl:634
[2] checked_trunc_uint
@ ./boot.jl:664 [inlined]
[3] toUInt32
@ ./boot.jl:748 [inlined]
[4] UInt32
@ ./boot.jl:788 [inlined]
[5] convert
@ ./number.jl:7 [inlined]
[6] ParseStreamPosition
@ ~/.julia/packages/JuliaSyntax/EGQXe/src/parse_stream.jl:168 [inlined]
[7] fix_macro_name_kind!(ps::JuliaSyntax.ParseState, macro_name_position::JuliaSyntax.ParseStreamPosition, name_kind::Nothing)
@ JuliaSyntax ~/.julia/packages/JuliaSyntax/EGQXe/src/parser.jl:2344
[8] fix_macro_name_kind!
@ ~/.julia/packages/JuliaSyntax/EGQXe/src/parser.jl:2336 [inlined]
[9] parse_call_chain(ps::JuliaSyntax.ParseState, mark::JuliaSyntax.ParseStreamPosition, is_macrocall::Bool)
@ JuliaSyntax ~/.julia/packages/JuliaSyntax/EGQXe/src/parser.jl:1513
[10] parse_atom(ps::JuliaSyntax.ParseState, check_identifiers::Bool)
@ JuliaSyntax ~/.julia/packages/JuliaSyntax/EGQXe/src/parser.jl:3539
[11] parse_atom
@ ~/.julia/packages/JuliaSyntax/EGQXe/src/parser.jl:3391 [inlined]
[12] parse_unary_prefix(ps::JuliaSyntax.ParseState) So I ... think this is probably fixed already and can be closed. But please do reopen if you find a case which doesn't work on |
Ok, I just realized this was probably the same or similar to some of the cases covered in #186. Those are generated by fuzz testing tools but turn out to be quite relevant to code fragments OhMyREPL users might have trouble with. |
apologies that I don't have much in the way of help here. i don't really have a reproducer
The text was updated successfully, but these errors were encountered: