Store edits in trees, not by splitting stack
This allows for multiple edits per parse, though it is not exposed through the API yet
This commit is contained in:
parent
0467d190fe
commit
b3d883e128
11 changed files with 169 additions and 333 deletions
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef RUNTIME_STACK_H_
|
||||
#define RUNTIME_STACK_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "tree_sitter/parser.h"
|
||||
|
||||
typedef struct {
|
||||
TSTree *node;
|
||||
TSStateId state;
|
||||
} TSStackEntry;
|
||||
|
||||
typedef struct {
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
TSStackEntry *entries;
|
||||
} TSStack;
|
||||
|
||||
TSStack ts_stack_make();
|
||||
void ts_stack_delete(TSStack *);
|
||||
void ts_stack_shrink(TSStack *stack, size_t new_size);
|
||||
void ts_stack_push(TSStack *stack, TSStateId state, TSTree *node);
|
||||
TSStateId ts_stack_top_state(const TSStack *stack);
|
||||
TSTree *ts_stack_top_node(const TSStack *stack);
|
||||
TSLength ts_stack_total_tree_size(const TSStack *stack);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // RUNTIME_STACK_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue