Remove TSLength from runtime header
Refactor node functions now that character offset and byte offset are stored separately
This commit is contained in:
parent
8e217f758c
commit
22c76fc71b
6 changed files with 101 additions and 106 deletions
|
|
@ -16,6 +16,11 @@ typedef struct TSTree TSTree;
|
|||
|
||||
typedef unsigned short TSStateId;
|
||||
|
||||
typedef struct {
|
||||
size_t bytes;
|
||||
size_t chars;
|
||||
} TSLength;
|
||||
|
||||
typedef struct {
|
||||
bool visible : 1;
|
||||
bool named : 1;
|
||||
|
|
|
|||
|
|
@ -8,11 +8,6 @@ extern "C" {
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct {
|
||||
size_t bytes;
|
||||
size_t chars;
|
||||
} TSLength;
|
||||
|
||||
typedef struct {
|
||||
void *payload;
|
||||
const char *(*read_fn)(void *payload, size_t *bytes_read);
|
||||
|
|
@ -42,8 +37,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
const void *data;
|
||||
TSLength offset;
|
||||
size_t row;
|
||||
size_t offset[3];
|
||||
} TSNode;
|
||||
|
||||
typedef unsigned short TSSymbol;
|
||||
|
|
@ -51,10 +45,10 @@ typedef struct TSLanguage TSLanguage;
|
|||
typedef struct TSDocument TSDocument;
|
||||
|
||||
size_t ts_node_start_char(TSNode);
|
||||
size_t ts_node_end_char(TSNode);
|
||||
size_t ts_node_start_byte(TSNode);
|
||||
size_t ts_node_end_byte(TSNode);
|
||||
TSPoint ts_node_start_point(TSNode);
|
||||
size_t ts_node_end_char(TSNode);
|
||||
size_t ts_node_end_byte(TSNode);
|
||||
TSPoint ts_node_end_point(TSNode);
|
||||
TSSymbol ts_node_symbol(TSNode);
|
||||
const char *ts_node_name(TSNode, const TSDocument *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue