tree-sitter-vim icon indicating copy to clipboard operation
tree-sitter-vim copied to clipboard

bug: `<cmd>` mappings with range prefix parse as `ERROR`

Open Diomendius opened this issue 1 year ago • 0 comments

Did you check existing issues?

  • [x] I have read all the tree-sitter docs if it relates to using the parser
  • [X] I have searched the existing issues

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.22.6 (b40f342067a89cd6331bf4c27407588320f3c263)

Describe the bug

map Y :%y<cr> and map Y <cmd>y<cr> are correctly parsed, but combining <cmd> with a range prefix like %, 1 or 1,5 produces a parse tree with an ERROR.

This happens as of revision f3cd62d8bd043ef20507e84bb6b4b53731ccf3a7 of this repo.

Steps To Reproduce/Bad Parse Tree

Run echo 'map Y <cmd>%y<cr>' > repro.vim && tree-sitter parse repro.vim to produce this parse tree:

(script_file [0, 0] - [1, 0]
  (ERROR [0, 0] - [0, 17]
    (map_side [0, 4] - [0, 5])
    (keycode [0, 6] - [0, 11])
    (file [0, 11] - [0, 12])
    (marker_definition [0, 12] - [0, 17])))

Expected Behavior/Parse Tree

The parse tree should not include an ERROR.

Repro

No response

Diomendius avatar Aug 19 '24 07:08 Diomendius