Consolidate logic for deciding on a lookahead node
This commit is contained in:
parent
41074cbf2d
commit
4a0587061e
3 changed files with 82 additions and 57 deletions
|
|
@ -11,6 +11,12 @@ extern "C" {
|
|||
#include "runtime/reusable_node.h"
|
||||
#include "runtime/reduce_action.h"
|
||||
|
||||
typedef struct {
|
||||
Tree *token;
|
||||
Tree *last_external_token;
|
||||
uint32_t byte_index;
|
||||
} TokenCache;
|
||||
|
||||
typedef struct {
|
||||
Lexer lexer;
|
||||
Stack *stack;
|
||||
|
|
@ -20,8 +26,7 @@ typedef struct {
|
|||
bool is_split;
|
||||
bool print_debugging_graphs;
|
||||
Tree scratch_tree;
|
||||
Tree *cached_token;
|
||||
uint32_t cached_token_byte_index;
|
||||
TokenCache token_cache;
|
||||
ReusableNode reusable_node;
|
||||
TreePath tree_path1;
|
||||
TreePath tree_path2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue