gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
230 stars 21 forks source link

small bug in parser #48

Closed dahtah closed 2 years ago

dahtah commented 3 years ago

This occurs when using LaTeXStrings.jl with autocompletion with company-capf turned on. Typing L"\a" results in some kind of string escaping error

Base.Meta.ParseError("\"\\\" is not a unary operator")

parse(::String, ::Int64; greedy::Bool, raise::Bool, depwarn::Bool) at meta.jl:184
parse at meta.jl:176 [inlined]
parse(::String; raise::Bool, depwarn::Bool) at meta.jl:215
parse(::String) at meta.jl:215
macro expansion at JuliaSnail.jl:540 [inlined]
(::Main.JuliaSnail.var"#33#38"{Sockets.TCPSocket})() at task.jl:356
gcv commented 3 years ago

I'm not entirely sure what's going on here. The error seems to happen here: https://github.com/gcv/julia-snail/blob/03b4296ba7151963eb3c850f3314b02644101f51/JuliaSnail.jl#L540 Meta.parse doesn't like the fully escaped string passed to it. It might be related to backslash quoting complexity in julia-snail-repl-completion-at-point. @orialb, do you have any ideas?

orialb commented 3 years ago

sorry for the late response, just saw this now. It seems that indeed there is some conflict between properly escaping the string quotes and the backslash. I will try to find some time this week to take a look.

gcv commented 2 years ago

@dahtah: Looking into this report again, and I can't reproduce it any more. Julia 1.6.2, latest Snail.

gcv commented 2 years ago

Please reopen this ticket if you still see this bug.