Remove generated parsers' dependency on runtime.h

This commit is contained in:
Max Brunsfeld 2016-10-05 14:02:49 -07:00
parent b94a7bfd71
commit e149d94ff5
24 changed files with 181 additions and 167 deletions

View file

@ -1,9 +1,16 @@
#ifndef RUNTIME_LENGTH_H_
#define RUNTIME_LENGTH_H_
#include "tree_sitter/parser.h"
#include <stdlib.h>
#include <stdbool.h>
typedef struct {
size_t bytes;
size_t chars;
size_t rows;
size_t columns;
} TSLength;
static inline bool ts_length_is_unknown(TSLength self) {
return self.chars > 0 && self.bytes == 0;
}