tree-sitter/src/runtime/node.h
Max Brunsfeld 3430a5edcc Clarify distinction btwn tree padding, tree offset, node position
- Node position is public. It represents the node's first character
  index in the document.
- Tree offset is private. It represents the distance between the tree's
  first character index and it's parent's first character index.
- Tree padding is private. It represents the amount of whitespace
  (or other separator characters) immediately preceding the tree.
2014-08-28 13:22:06 -07:00

20 lines
460 B
C

#ifndef RUNTIME_NODE_H_
#define RUNTIME_NODE_H_
#include "tree_sitter/parser.h"
#include "runtime/tree.h"
struct TSNode {
size_t ref_count;
size_t position;
size_t index;
const TSTree *content;
struct TSNode *parent;
const char **names;
};
TSNode *ts_node_make(const TSTree *tree, TSNode *parent, size_t index,
size_t position, const char **names);
TSNode *ts_node_make_root(const TSTree *tree, const char **names);
#endif