Refactoring some stuff in the parser lib, moving functions out of headers

This commit is contained in:
Maix0 2024-07-04 00:43:43 +02:00
parent 4580d68951
commit fb3a2d94a0
19 changed files with 522 additions and 608 deletions

View file

@ -1,27 +1,30 @@
#ifndef TREE_SITTER_TREE_H_
#define TREE_SITTER_TREE_H_
#ifndef TREE_H
#define TREE_H
#include "me/types.h"
#include "./subtree.h"
#include "me/types.h"
typedef struct ParentCacheEntry
{
const Subtree *child;
const Subtree *parent;
Length position;
TSSymbol alias_symbol;
} ParentCacheEntry;
typedef struct ParentCacheEntry ParentCacheEntry;
struct TSTree
{
Subtree root;
const TSLanguage *language;
TSRange *included_ranges;
t_u32 included_range_count;
t_u32 included_range_count;
};
struct ParentCacheEntry
{
const Subtree *child;
const Subtree *parent;
Length position;
TSSymbol alias_symbol;
};
TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *, t_u32);
TSNode ts_node_new(const TSTree *, const Subtree *, Length, TSSymbol);
#endif // TREE_SITTER_TREE_H_
#endif // TREE_H