Allow lookahead to be broken down further after performing reductions

This commit is contained in:
Max Brunsfeld 2016-07-01 15:08:19 -07:00
parent 0e2bbbd7ee
commit c3a242740b
3 changed files with 164 additions and 98 deletions

View file

@ -9,6 +9,11 @@ extern "C" {
#include "runtime/array.h"
#include "runtime/reduce_action.h"
typedef struct {
TSTree *tree;
size_t char_index;
} ReusableNode;
typedef struct {
TSLexer lexer;
Stack *stack;
@ -18,6 +23,9 @@ typedef struct {
bool is_split;
bool print_debugging_graphs;
TSTree scratch_tree;
TSTree *cached_token;
size_t cached_token_char_index;
ReusableNode reusable_node;
} TSParser;
bool ts_parser_init(TSParser *);