@@ -2403,6 +2403,8 @@ function parse_atsym(ps::ParseState, allow_quotes=true)
2403
2403
# export outer ==> (export outer)
2404
2404
# export ($f) ==> (export ($ f))
2405
2405
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.
2406
2408
if allow_quotes && peek (ps) == K " :" && ! is_closing_token (ps, peek (ps,2 ))
2407
2409
# import A.:+ ==> (import (importpath A (quote-: +)))
2408
2410
emit_diagnostic (ps, warning= " quoting with `:` is not required here" )
@@ -2423,10 +2425,10 @@ function parse_atsym(ps::ParseState, allow_quotes=true)
2423
2425
warn_parens = true
2424
2426
end
2425
2427
end
2426
- if warn_parens
2428
+ b = peek_behind (ps, pos)
2429
+ if warn_parens && b. orig_kind != K " .."
2427
2430
emit_diagnostic (ps, mark, warning= " parentheses are not required here" )
2428
2431
end
2429
- b = peek_behind (ps, pos)
2430
2432
ok = (b. is_leaf && (b. kind == K " Identifier" || is_operator (b. kind))) ||
2431
2433
(! b. is_leaf && b. kind in KSet " $ var" )
2432
2434
if ! ok
@@ -2497,7 +2499,7 @@ function parse_import(ps::ParseState, word, has_import_prefix)
2497
2499
# import A: x as y ==> (import (: (importpath A) (as (importpath x) y)))
2498
2500
# using A: x as y ==> (using (: (importpath A) (as (importpath x) y)))
2499
2501
bump (ps, TRIVIA_FLAG)
2500
- parse_atsym (ps)
2502
+ parse_atsym (ps, false )
2501
2503
emit (ps, mark, K " as" )
2502
2504
if word == K " using" && ! has_import_prefix
2503
2505
# using A as B ==> (using (error (as (importpath A) B)))
@@ -2552,7 +2554,7 @@ function parse_import_path(ps::ParseState)
2552
2554
else
2553
2555
# import @x ==> (import (importpath @x))
2554
2556
# import $A ==> (import (importpath ($ A)))
2555
- parse_atsym (ps)
2557
+ parse_atsym (ps, false )
2556
2558
end
2557
2559
while true
2558
2560
t = peek_token (ps)
0 commit comments