Skip to content
Discussion options

You must be logged in to vote

From your comments in #41 I think you may be confusing node names with field names. Tree sitter has some docs here explaining and I'll try to elaborate on what I said there:

As an example, consider this code (no particular language)

if foo then
  bar
else
  1 + 2

It could get parsed by tree-sitter into something like

(if
  condition: (identifier)
  consequent: (identifier)
  alternate: (add
               lhs: (integer) 
               rhs: (integer))

Here the field names are condition, consequent, alternate, lhs, and rhs . But these are not properties of the nodes themselves. These are just labeled slots of the if and add nodes. The children have no knowledge of their field names.

is_n…

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by euclidianAce
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@euclidianAce
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #46 on August 17, 2026 21:35.