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

better error for help on invalid characters #30506

Closed
inkydragon opened this issue Dec 25, 2018 · 4 comments
Closed

better error for help on invalid characters #30506

inkydragon opened this issue Dec 25, 2018 · 4 comments
Labels
error handling Handling of exceptions by Julia or the user needs decision A decision on this change is needed parser Language parsing and surface syntax REPL Julia's REPL (Read Eval Print Loop)

Comments

@inkydragon
Copy link
Member

Set Difference: \setminus, it should equal to setdiff()

error can be reproducted on: v0.64/v0.7/v1.0/v1.02/v1.0.3

help?> ∖
ERROR: LoadError: Invalid @var syntax `invalid character "∖"`.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] splitexpr(::Any) at .\docs\bindings.jl:28
 [3] bindingexpr(::Any) at .\docs\bindings.jl:17
 [4] lookup_doc(::Expr) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\REPL\src\docview.jl:137
 [5] docm(::LineNumberNode, ::Module, ::Any) at .\docs\Docs.jl:501
 [6] @doc(::LineNumberNode, ::Module, ::Expr, ::Vararg{Expr,N} where N) at .\boot.jl:451
in expression starting at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\REPL\src\docview.jl:301

julia> Char('')
'': Unicode U+2216 (category Sm: Symbol, math)
@JeffBezanson JeffBezanson added the parser Language parsing and surface syntax label Dec 26, 2018
@JeffBezanson
Copy link
Member

Not specific to help mode; we have this marked as an invalid character probably because it is so similar to backslash. It would be possible to parse it as an operator though.

@inkydragon
Copy link
Member Author

So, should we add it to the base just like other set opreater in #6582 ?
or keep the status quo

@JeffBezanson JeffBezanson changed the title ?\setminus <tab> raise an error "Invalid @var syntax" allow parsing \setminus? Dec 30, 2018
@JeffBezanson JeffBezanson added the needs decision A decision on this change is needed label Dec 30, 2018
@Keno
Copy link
Member

Keno commented Dec 31, 2018

Seems like help mode could be more helpful here and say that the character is disallowed independent of whether we end up allowing it.

@stevengj
Copy link
Member

stevengj commented Jan 4, 2019

I would vote in favor of not allowing it, as it is too similar to \.

A help message rather than an exception for non-parseable strings sounds good.

@JeffBezanson JeffBezanson added the REPL Julia's REPL (Read Eval Print Loop) label Jan 4, 2019
@JeffBezanson JeffBezanson changed the title allow parsing \setminus? better error for help on invalid characters Jan 4, 2019
@JeffBezanson JeffBezanson added the error handling Handling of exceptions by Julia or the user label Jan 4, 2019
KristofferC pushed a commit that referenced this issue Feb 4, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506. 

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Apr 20, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user needs decision A decision on this change is needed parser Language parsing and surface syntax REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

4 participants