aboutsummaryrefslogtreecommitdiff
path: root/src/tree_sitter/tree.h
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2019-12-15 21:17:16 -0500
committerJames McCoy <jamessan@jamessan.com>2019-12-15 21:17:16 -0500
commit6566251d144d2c9c9e08e05c8c3a3fe9915a19b8 (patch)
tree980fd0c7287e295c8ac72858b0794f72224415e0 /src/tree_sitter/tree.h
parent9c4223215f71e1212462ada4e698be1b31437dd9 (diff)
parent9f3d483c79f03c48239fdc82cc02e8685a03d22a (diff)
downloadrneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.tar.gz
rneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.tar.bz2
rneovim-6566251d144d2c9c9e08e05c8c3a3fe9915a19b8.zip
Merge remote-tracking branch 'upstream/master' into libcall
Diffstat (limited to 'src/tree_sitter/tree.h')
-rw-r--r--src/tree_sitter/tree.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tree_sitter/tree.h b/src/tree_sitter/tree.h
new file mode 100644
index 0000000000..92a7e64179
--- /dev/null
+++ b/src/tree_sitter/tree.h
@@ -0,0 +1,34 @@
+#ifndef TREE_SITTER_TREE_H_
+#define TREE_SITTER_TREE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ const Subtree *child;
+ const Subtree *parent;
+ Length position;
+ TSSymbol alias_symbol;
+} ParentCacheEntry;
+
+struct TSTree {
+ Subtree root;
+ const TSLanguage *language;
+ ParentCacheEntry *parent_cache;
+ uint32_t parent_cache_start;
+ uint32_t parent_cache_size;
+ TSRange *included_ranges;
+ unsigned included_range_count;
+};
+
+TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *, unsigned);
+TSNode ts_node_new(const TSTree *, const Subtree *, Length, TSSymbol);
+TSNode ts_tree_get_cached_parent(const TSTree *, const TSNode *);
+void ts_tree_set_cached_parent(const TSTree *, const TSNode *, const TSNode *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // TREE_SITTER_TREE_H_