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:
Max Brunsfeld 2015-09-13 19:47:45 -07:00
parent 0467d190fe
commit b3d883e128
11 changed files with 169 additions and 333 deletions

View file

@ -5,15 +5,16 @@
extern "C" {
#endif
#include "runtime/stack.h"
#include "runtime/parse_stack.h"
typedef struct {
TSLexer lexer;
ParseStack *stack;
TSStack right_stack;
size_t total_chars;
TSTree *lookahead;
TSTree *previous_tree;
TSTree *reusable_subtree;
size_t reusable_subtree_pos;
bool is_verifying;
const TSLanguage *language;
} TSParser;
@ -21,7 +22,7 @@ TSParser ts_parser_make();
void ts_parser_destroy(TSParser *);
TSDebugger ts_parser_debugger(const TSParser *);
void ts_parser_set_debugger(TSParser *, TSDebugger);
TSTree *ts_parser_parse(TSParser *, TSInput, TSInputEdit *);
TSTree *ts_parser_parse(TSParser *, TSInput);
#ifdef __cplusplus
}