@@ -1449,33 +1449,42 @@ function parse_call_chain(ps::ParseState, mark, is_macrocall=false)
14491449 end
14501450 elseif k == K " ["
14511451 if is_macrocall
1452- # a().@x[1] ==> (macrocall (ref ( error (. (call a) (quote x))) 1))
1452+ # a().@x[1] ==> (macrocall (error (. (call a) (quote x))) (vect 1))
14531453 finish_macroname (ps, mark, valid_macroname, macro_name_position)
14541454 end
1455+ m = position (ps)
14551456 # a [i] ==> (ref a (error-t) i)
14561457 bump_disallowed_space (ps)
14571458 bump (ps, TRIVIA_FLAG)
14581459 ckind, cflags = parse_cat (ParseState (ps, end_symbol= true ),
14591460 K " ]" , ps. end_symbol)
1460- # a[i] ==> (ref a i)
1461- # a[i,j] ==> (ref a i j)
1462- # (a=1)[] ==> (ref (= a 1))
1463- # T[x y] ==> (typed_hcat T x y)
1464- # T[x ; y] ==> (typed_vcat T x y)
1465- # T[a b; c d] ==> (typed_vcat T (row a b) (row c d))
1466- # T[x for x in xs] ==> (typed_comprehension T (generator x (= x xs)))
1467- # v1.8: T[a ; b ;; c ; d] ==> (typed_ncat-2 T (nrow-1 a b) (nrow-1 c d))
1468- outk = ckind == K " vect" ? K " ref" :
1469- ckind == K " hcat" ? K " typed_hcat" :
1470- ckind == K " vcat" ? K " typed_vcat" :
1471- ckind == K " comprehension" ? K " typed_comprehension" :
1472- ckind == K " ncat" ? K " typed_ncat" :
1473- internal_error (" unrecognized kind in parse_cat " , ckind)
1474- emit (ps, mark, outk, cflags)
1475- check_ncat_compat (ps, mark, ckind)
14761461 if is_macrocall
1462+ # @S[a,b] ==> (macrocall @S (vect a b))
1463+ # @S[a b] ==> (macrocall @S (hcat a b))
1464+ # @S[a; b] ==> (macrocall @S (vcat a b))
1465+ # v1.7: @S[a ;; b] ==> (macrocall @S (ncat-2 a b))
1466+ # v1.6: @S[a ;; b] ==> (macrocall @S (error (ncat-2 a b)))
1467+ emit (ps, m, ckind, cflags)
1468+ check_ncat_compat (ps, m, ckind)
14771469 emit (ps, mark, K " macrocall" )
14781470 break
1471+ else
1472+ # a[i] ==> (ref a i)
1473+ # a[i,j] ==> (ref a i j)
1474+ # (a=1)[] ==> (ref (= a 1))
1475+ # T[x y] ==> (typed_hcat T x y)
1476+ # T[x ; y] ==> (typed_vcat T x y)
1477+ # T[a b; c d] ==> (typed_vcat T (row a b) (row c d))
1478+ # T[x for x in xs] ==> (typed_comprehension T (generator x (= x xs)))
1479+ # v1.8: T[a ; b ;; c ; d] ==> (typed_ncat-2 T (nrow-1 a b) (nrow-1 c d))
1480+ outk = ckind == K " vect" ? K " ref" :
1481+ ckind == K " hcat" ? K " typed_hcat" :
1482+ ckind == K " vcat" ? K " typed_vcat" :
1483+ ckind == K " comprehension" ? K " typed_comprehension" :
1484+ ckind == K " ncat" ? K " typed_ncat" :
1485+ internal_error (" unrecognized kind in parse_cat " , ckind)
1486+ emit (ps, mark, outk, cflags)
1487+ check_ncat_compat (ps, mark, ckind)
14791488 end
14801489 elseif k == K " ."
14811490 # x .y ==> (. x (error-t) (quote y))
0 commit comments