Skip to content

Commit 6a9104a

Browse files
committed
fix (typed_)ncat prime parsing
1 parent 4368243 commit 6a9104a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/components/operators.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,11 @@ function parse_operator(ps::ParseState, ret::EXPR, op::EXPR)
471471
ret = EXPR(op, EXPR[ret], nothing)
472472
elseif is_prime(op)
473473
if isidentifier(ret) || isliteral(ret) ||
474-
headof(ret) in (:call, :tuple, :brackets, :ref, :vect, :vcat, :hcat, :typed_vcat, :typed_hcat, :comprehension, :typed_comprehension, :curly, :braces, :braces_cat) ||
474+
headof(ret) in (
475+
:call, :tuple, :brackets, :ref, :vect, :vcat, :hcat, :ncat, :typed_vcat,
476+
:typed_hcat, :typed_ncat, :comprehension, :typed_comprehension, :curly,
477+
:braces, :braces_cat
478+
) ||
475479
headof(ret) === :do ||
476480
is_dot(headof(ret)) ||
477481
is_prime(headof(ret))

test/parser.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,7 @@ end
511511
@test "[x;;]" |> test_expr
512512
@test "[x;; y;; z]" |> test_expr
513513
@test "[x;;; y;;;z]" |> test_expr
514-
end
515-
516-
@testset "ncat" begin
514+
@test "[x;;; y;;;z]'" |> test_expr
517515
@test "[1 2; 3 4]" |> test_expr
518516
@test "[1;2;;3;4;;5;6;;;;9]" |> test_expr
519517
end
@@ -527,6 +525,7 @@ end
527525
@test "t[x;;; y;;;z]" |> test_expr
528526
@test "t[x;;\ny]" |> test_expr
529527
@test "t[x y;;\nz a]" |> test_expr
528+
@test "t[x y;;\nz a]'" |> test_expr
530529
end
531530
end
532531

0 commit comments

Comments
 (0)