Open ronisbr opened 7 months ago
It seems that the work around is to change the order:
v = 1:10
for k in 1:10
v[k - 1 + begin]
end
I observed the same issue
Yeah, the way these words that can be keywords or identifiers are handled is still very hacky.
In this case what happens is that the parser sees begin
and then sees +k
as if it was a unary expression. Reversing the order means begin
is only followed by the closing bracket, so it must be an identifier.
Lezer (tree-sitter for codemirror) actually introduced a very good way of handling these keyword/identifier cases (\@extend), and this makes a massive difference between the existing grammar and the rewrite I'm working on. Hopefully a similar improvement can be made here.
Hi!
The following code:
is not parsed correctly by the current grammar: