LhKipp / tree-sitter-nu

A tree-sitter grammar for the nushell language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing fails for variable followed by pipe on a new line

aikow opened this issue · comments

Thanks again for putting in the work for creating (and maintaining) the tree-sitter parser :) .

Issue

export def [f: path] {
  $f
  | path basename
}

The above example fails to parse in neovim using the latest grammar. The exact error is at the | symbol.

Output of :InspectTree in neovim.

(ERROR) ; [1:1 - 20]
 (array) ; [1:11 - 20]
  (command) ; [1:13 - 19]
   cmd_name: (identifier) ; [1:13 - 13]
   arg: (word) ; [1:14 - 14]
   arg: (identifier) ; [1:15 - 19]
(record_or_block) ; [1:21 - 3:0]
 (value_path) ; [1:23 - 2:4]
  (identifier) ; [2:4 - 4]
(command) ; [3:4 - 17]
 cmd_name: (identifier) ; [3:4 - 8]
 arg: (identifier) ; [3:9 - 17]
(ERROR) ; [4:1 - 5:0]
 (ERROR) ; [4:2 - 5:0]

If you point me to a line number where I can start looking, I can try to help fix this myself.