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

Incorrect Unnamed Node Range

Open berchn opened this issue 3 years ago • 0 comments

I'm using this string: "#define a \n". The following is a list representation of the parse tree including the unnamed nodes:

(:TRANSLATION-UNIT ((0 0) (0 1))
 ((:PREPROC-DEF ((0 0) (0 1))
   ((:|#DEFINE| ((0 0) (7 0)) NIL)
    ((:NAME :IDENTIFIER) ((8 0) (9 0)) NIL)
    (:|
|
     ((9 0) (0 1)) NIL)))))

In the parse tree, the newline starts at (9 0), but in the provided string above, the space after the a is at (9 0) and the newline is at (10 0). Is this behavior expected?

berchn avatar May 10 '21 18:05 berchn