Closed Chris00 closed 7 months ago
Hm not sure i see the same on my end, this is what I'm seeing:
$ ts p test.rs
(source_file [0, 0] - [1, 0]
(const_item [0, 0] - [0, 35]
name: (identifier [0, 6] - [0, 7])
type: (primitive_type [0, 9] - [0, 12])
value: (binary_expression [0, 15] - [0, 34]
left: (integer_literal [0, 15] - [0, 16])
(block_comment [0, 17] - [0, 30])
right: (integer_literal [0, 33] - [0, 34]))))
Which at first glance, might look incorrect because the operator is missing. The CLI omits them when they are just literals, looking at it with some more info (on an unreleased fork or neovim's InspectTree) results in this:
Which seems ok to me. Let me know if I'm wrong!
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
Pasing
const X: u32 = 1 /* comment */ + 1;
considers the comment as the binary operator (see first parse tree below) while it should be basically parsed asconst X: u32 = (1 /* comment */) + 1;
(see second parse tree below).Steps To Reproduce/Bad Parse Tree
Expected Behavior/Parse Tree
Repro