tree-sitter / tree-sitter-julia

Julia grammar for Tree-sitter
MIT License
93 stars 31 forks source link

Incorrectly parsed tuple assignment in let statement #119

Closed Joel-Dahne closed 4 months ago

Joel-Dahne commented 9 months ago

The statement

let (x, y) = (0, 1)
    y
end

is valid Julia code. However, tree-sitter doesn't like it. Using the Emacs julia-ts-mode with treesit-explore-mode I get the output

(source_file
 (ERROR let)
 (assignment
  (tuple_expression ( (identifier) , (identifier) ))
  (operator)
  (tuple_expression ( (integer_literal) , (integer_literal) )))
 \n (identifier) \n (identifier) \n)

Unfortunately I haven't been able to figure out how to determine the version of the grammar I have installed.

Note that

let x, y = (0, 1)
    y
end

is not valid Julia code. This is likely related to why the above doesn't work as expected.

dhanak commented 7 months ago

I just ran into the same issue :-(.