@@ -2403,6 +2403,8 @@ function parse_atsym(ps::ParseState, allow_quotes=true)
24032403 # export outer ==> (export outer)
24042404 # export ($f) ==> (export ($ f))
24052405 mark = position (ps)
2406+ # Syntax Edition TODO : make all the various ways to quote things inside
2407+ # import paths an error and require `var""` in the few remaining cases.
24062408 if allow_quotes && peek (ps) == K " :" && ! is_closing_token (ps, peek (ps,2 ))
24072409 # import A.:+ ==> (import (importpath A (quote-: +)))
24082410 emit_diagnostic (ps, warning= " quoting with `:` is not required here" )
@@ -2423,10 +2425,10 @@ function parse_atsym(ps::ParseState, allow_quotes=true)
24232425 warn_parens = true
24242426 end
24252427 end
2426- if warn_parens
2428+ b = peek_behind (ps, pos)
2429+ if warn_parens && b. orig_kind != K " .."
24272430 emit_diagnostic (ps, mark, warning= " parentheses are not required here" )
24282431 end
2429- b = peek_behind (ps, pos)
24302432 ok = (b. is_leaf && (b. kind == K " Identifier" || is_operator (b. kind))) ||
24312433 (! b. is_leaf && b. kind in KSet " $ var" )
24322434 if ! ok
@@ -2497,7 +2499,7 @@ function parse_import(ps::ParseState, word, has_import_prefix)
24972499 # import A: x as y ==> (import (: (importpath A) (as (importpath x) y)))
24982500 # using A: x as y ==> (using (: (importpath A) (as (importpath x) y)))
24992501 bump (ps, TRIVIA_FLAG)
2500- parse_atsym (ps)
2502+ parse_atsym (ps, false )
25012503 emit (ps, mark, K " as" )
25022504 if word == K " using" && ! has_import_prefix
25032505 # using A as B ==> (using (error (as (importpath A) B)))
@@ -2552,7 +2554,7 @@ function parse_import_path(ps::ParseState)
25522554 else
25532555 # import @x ==> (import (importpath @x))
25542556 # import $A ==> (import (importpath ($ A)))
2555- parse_atsym (ps)
2557+ parse_atsym (ps, false )
25562558 end
25572559 while true
25582560 t = peek_token (ps)
0 commit comments