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

Parser warning for using EllipsisNotation: (..) as …: “parentheses are not required here” #54351

Closed
Socob opened this issue May 3, 2024 · 1 comment
Labels
parser Language parsing and surface syntax

Comments

@Socob
Copy link
Contributor

Socob commented May 3, 2024

Running the following file (which intentionally has invalid syntax at the end to trigger the syntax warning, which doesn’t seem to appear otherwise?):

using EllipsisNotation: .. as …

(

gives a warning on the line using EllipsisNotation: .. as … (in addition to the syntax error):

ERROR: LoadError: ParseError:
# Warning @ ~/tmp.jl:1:25
using EllipsisNotation: (..) as …
#                       └──┘ ── parentheses are not required here
# Error @ ~/tmp.jl:3:3

(
#
└ ── Expected `)`
Stacktrace:
 [1] top-level scope
   @ ~/tmp/tmp.jl:3
in expression starting at ~/tmp.jl:3

However, the parentheses do seem to be required, as evidenced by what happens when omitting them:

using EllipsisNotation: .. as …

Resulting error:

ERROR: LoadError: ParseError:
# Warning @ ~/tmp.jl:1:27
using EllipsisNotation: .. as …
#                         ╙ ── space between dots in import path
# Error @ ~/tmp.jl:2:2
using EllipsisNotation: .. as …

#└ ── premature end of input
Stacktrace:
 [1] top-level scope
   @ ~/tmp/tmp.jl:2
in expression starting at ~/tmp.jl:2

  1. The output of versioninfo():
Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 4800H with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
  1. How you installed Julia: juliaup
  2. A minimal working example (MWE), also known as a minimum reproducible example: see above
@jishnub jishnub added the parser Language parsing and surface syntax label May 4, 2024
@ericphanson
Copy link
Contributor

Xref JuliaLang/JuliaSyntax.jl#350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

4 participants