feat: implement a cache for get_column
This commit is contained in:
parent
a767f89967
commit
aaba7cd2f9
3 changed files with 84 additions and 22 deletions
|
|
@ -10,6 +10,11 @@ extern "C" {
|
|||
#include "tree_sitter/api.h"
|
||||
#include "./parser.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t value;
|
||||
bool valid;
|
||||
} ColumnData;
|
||||
|
||||
typedef struct {
|
||||
TSLexer data;
|
||||
Length current_position;
|
||||
|
|
@ -27,6 +32,7 @@ typedef struct {
|
|||
uint32_t chunk_size;
|
||||
uint32_t lookahead_size;
|
||||
bool did_get_column;
|
||||
ColumnData column_data;
|
||||
|
||||
char debug_buffer[TREE_SITTER_SERIALIZATION_BUFFER_SIZE];
|
||||
} Lexer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue