tree-sitter / tree-sitter-julia

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

Update arrays and tuples #82

Closed savq closed 1 year ago

savq commented 1 year ago

Arrays:

Tuples:


savq commented 1 year ago

Right now this PR has a small regression.

An expression like:

[2:x-1, 1]

Will be parsed as

(matrix_expression
  (matrix_row (range_expression (integer_literal) (identifier)
  (matrix_row (unary_expression (operator) (identifier))
  (ERROR)
  ...)

Basically, it parses 2:x and -1 as separate expressions so it thinks this is a matrix, not a vector.

I have no idea on how to handle the space-sensitive mode of the femtolisp parser.