Clean up tree array assertions in stack spec

This commit is contained in:
Max Brunsfeld 2016-02-22 09:23:25 -08:00
parent b113dc8b0f
commit f444a715fd
5 changed files with 29 additions and 46 deletions

View file

@ -7,6 +7,7 @@ extern "C" {
#include "tree_sitter/parser.h"
#include "runtime/array.h"
#include "runtime/tree.h"
typedef struct Stack Stack;
@ -16,8 +17,6 @@ typedef struct {
TSLength position;
} StackEntry;
typedef Array(TSTree *) TreeArray;
typedef struct {
TreeArray trees;
int head_index;

View file

@ -8,6 +8,7 @@ extern "C" {
#include <stdbool.h>
#include "tree_sitter/parser.h"
#include "runtime/length.h"
#include "runtime/array.h"
extern TSStateId TS_TREE_STATE_INDEPENDENT;
extern TSStateId TS_TREE_STATE_ERROR;
@ -42,6 +43,8 @@ struct TSTree {
bool has_changes : 1;
};
typedef Array(TSTree *) TreeArray;
TSTree *ts_tree_make_leaf(TSSymbol, TSLength, TSLength, TSSymbolMetadata);
TSTree *ts_tree_make_node(TSSymbol, size_t, TSTree **, TSSymbolMetadata);
TSTree *ts_tree_make_copy(TSTree *child);