@@ -844,8 +844,8 @@ function parse_range(ps::ParseState)
844
844
preceding_whitespace (peek_token (ps)) &&
845
845
! preceding_whitespace (peek_token (ps, 2 ))
846
846
# Tricky cases in space sensitive mode
847
- # [1 :a] ==> (hcat 1 (quote a))
848
- # [1 2:3 :a] ==> (hcat 1 (call-i 2 : 3) (quote a))
847
+ # [1 :a] ==> (hcat 1 (quote-: a))
848
+ # [1 2:3 :a] ==> (hcat 1 (call-i 2 : 3) (quote-: a))
849
849
break
850
850
end
851
851
t2 = peek_token (ps,2 )
@@ -1159,7 +1159,7 @@ function parse_unary(ps::ParseState)
1159
1159
is_syntactic_operator (op_k)
1160
1160
)
1161
1161
# `op_t` is not an initial operator
1162
- # :T ==> (quote T)
1162
+ # :T ==> (quote-: T)
1163
1163
# in::T ==> (:: in T)
1164
1164
# isa::T ==> (:: isa T)
1165
1165
parse_factor (ps)
@@ -1609,13 +1609,13 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
1609
1609
parse_call_arglist (ps, K " )" )
1610
1610
emit (ps, mark, K " dotcall" )
1611
1611
elseif k == K " :"
1612
- # A.:+ ==> (. A (quote +))
1613
- # A.: + ==> (. A (error-t) (quote +))
1612
+ # A.:+ ==> (. A (quote-: +))
1613
+ # A.: + ==> (. A (error-t) (quote-: +))
1614
1614
m = position (ps)
1615
1615
bump (ps, TRIVIA_FLAG)
1616
1616
bump_disallowed_space (ps)
1617
1617
parse_atom (ps, false )
1618
- emit (ps, m, K " quote" )
1618
+ emit (ps, m, K " quote" , COLON_QUOTE )
1619
1619
emit (ps, mark, K " ." )
1620
1620
elseif k == K " $"
1621
1621
# f.$x ==> (. f (inert ($ x)))
@@ -2374,21 +2374,21 @@ function parse_atsym(ps::ParseState, allow_quotes=true)
2374
2374
# export ($f) ==> (export ($ f))
2375
2375
mark = position (ps)
2376
2376
if allow_quotes && peek (ps) == K " :"
2377
- # import A.:+ ==> (import (importpath A (quote +)))
2377
+ # import A.:+ ==> (import (importpath A (quote-: +)))
2378
2378
emit_diagnostic (ps, warning= " quoting with `:` is not required here" )
2379
2379
end
2380
2380
parse_unary_prefix (ps)
2381
2381
pos = position (ps)
2382
2382
warn_parens = false
2383
2383
if peek_behind (ps, pos). kind == K " parens"
2384
- # import A.(:+) ==> (import (importpath A (parens (quote +))))
2384
+ # import A.(:+) ==> (import (importpath A (parens (quote-: +))))
2385
2385
pos = first_child_position (ps, pos)
2386
2386
warn_parens = true
2387
2387
end
2388
2388
if allow_quotes && peek_behind (ps, pos). kind == K " quote"
2389
2389
pos = first_child_position (ps, pos)
2390
2390
if peek_behind (ps, pos). kind == K " parens"
2391
- # import A.:(+) ==> (import (importpath A (quote (parens +))))
2391
+ # import A.:(+) ==> (import (importpath A (quote-: (parens +))))
2392
2392
pos = first_child_position (ps, pos)
2393
2393
warn_parens = true
2394
2394
end
@@ -3015,14 +3015,14 @@ function parse_paren(ps::ParseState, check_identifiers=true)
3015
3015
emit (ps, mark, K " tuple" , PARENS_FLAG)
3016
3016
elseif is_syntactic_operator (k)
3017
3017
# allow :(=) etc in unchecked contexts, eg quotes
3018
- # :(=) ==> (quote (parens =))
3018
+ # :(=) ==> (quote-: (parens =))
3019
3019
parse_atom (ps, check_identifiers)
3020
3020
bump_closing_token (ps, K " )" )
3021
3021
emit (ps, mark, K " parens" )
3022
3022
elseif ! check_identifiers && k == K " ::" &&
3023
3023
peek (ps, 2 , skip_newlines= true ) == K " )"
3024
3024
# allow :(::) as a special case
3025
- # :(::) ==> (quote (parens ::))
3025
+ # :(::) ==> (quote-: (parens ::))
3026
3026
bump (ps)
3027
3027
bump (ps, TRIVIA_FLAG, skip_newlines= true )
3028
3028
emit (ps, mark, K " parens" )
@@ -3415,7 +3415,7 @@ function parse_atom(ps::ParseState, check_identifiers=true)
3415
3415
emit (ps, mark, K " char" )
3416
3416
elseif leading_kind == K " :"
3417
3417
# symbol/expression quote
3418
- # :foo ==> (quote foo)
3418
+ # :foo ==> (quote-: foo)
3419
3419
t = peek_token (ps, 2 )
3420
3420
k = kind (t)
3421
3421
if is_closing_token (ps, k) && (! is_keyword (k) || preceding_whitespace (t))
@@ -3427,19 +3427,19 @@ function parse_atom(ps::ParseState, check_identifiers=true)
3427
3427
end
3428
3428
bump (ps, TRIVIA_FLAG) # K":"
3429
3429
if preceding_whitespace (t)
3430
- # : foo ==> (quote (error-t) foo)
3431
- # :\nfoo ==> (quote (error-t) foo)
3430
+ # : foo ==> (quote-: (error-t) foo)
3431
+ # :\nfoo ==> (quote-: (error-t) foo)
3432
3432
bump_trivia (ps, TRIVIA_FLAG, skip_newlines= true ,
3433
3433
error= " whitespace not allowed after `:` used for quoting" )
3434
3434
end
3435
3435
# Being inside quote makes keywords into identifiers at the
3436
3436
# first level of nesting
3437
- # :end ==> (quote end)
3438
- # :(end) ==> (quote (parens (error-t)))
3437
+ # :end ==> (quote-: end)
3438
+ # :(end) ==> (quote-: (parens (error-t)))
3439
3439
# Being inside quote makes end non-special again (issue #27690)
3440
- # a[:(end)] ==> (ref a (quote (error-t end)))
3440
+ # a[:(end)] ==> (ref a (quote-: (error-t end)))
3441
3441
parse_atom (ParseState (ps, end_symbol= false ), false )
3442
- emit (ps, mark, K " quote" )
3442
+ emit (ps, mark, K " quote" , COLON_QUOTE )
3443
3443
elseif check_identifiers && leading_kind == K " =" && is_plain_equals (peek_token (ps))
3444
3444
# = ==> (error =)
3445
3445
bump (ps, error= " unexpected `=`" )
@@ -3505,12 +3505,12 @@ function parse_atom(ps::ParseState, check_identifiers=true)
3505
3505
end
3506
3506
emit (ps, mark, K " var" )
3507
3507
elseif check_identifiers && is_closing_token (ps, leading_kind)
3508
- # :(end) ==> (quote (error end))
3508
+ # :(end) ==> (quote-: (error end))
3509
3509
bump (ps, error= " invalid identifier" )
3510
3510
else
3511
3511
# Remap keywords to identifiers.
3512
- # :end ==> (quote end)
3513
- # :<: ==> (quote <:)
3512
+ # :end ==> (quote-: end)
3513
+ # :<: ==> (quote-: <:)
3514
3514
bump (ps, remap_kind= K " Identifier" )
3515
3515
end
3516
3516
elseif leading_kind == K " (" # parens or tuple
0 commit comments