Skip to content

Commit de2a55e

Browse files
committed
Add diagnostics for CSTParser indexing bug
1 parent 5759e03 commit de2a55e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/iterate.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,9 @@ function _vcat(x, i)
717717
x.trivia[1]
718718
elseif i == length(x)
719719
x.trivia[2]
720+
elseif (i-1) > length(x.args)
721+
# TODO Remove once we have figured out what is causing this bug
722+
error("Illegal indexing into CSTParser. x.head: '$(x.head)', x.trivia: '$(x.trivia)', x.args: '$(x.args)'.")
720723
else
721724
x.args[i - 1]
722725
end

0 commit comments

Comments
 (0)