treesitter: update vendored tree-sitter runtime

tree-sitter/tree-sitter commit 6cb8d24de2d99c4c50c9a0fd1e719ca5b3abc87f

Included files are:
lib/include/tree-sitter/*.h
lib/src/*.[ch]
lib/src/unicode/*
LICENSE
This commit is contained in:
Björn Linse
2020-02-25 13:03:40 +01:00
parent 96059d72e5
commit 3ce9b05653
12 changed files with 242 additions and 156 deletions

View File

@@ -355,7 +355,7 @@ void ts_lexer_mark_end(Lexer *self) {
ts_lexer__mark_end(&self->data);
}
void ts_lexer_set_included_ranges(
bool ts_lexer_set_included_ranges(
Lexer *self,
const TSRange *ranges,
uint32_t count
@@ -363,6 +363,16 @@ void ts_lexer_set_included_ranges(
if (count == 0 || !ranges) {
ranges = &DEFAULT_RANGE;
count = 1;
} else {
uint32_t previous_byte = 0;
for (unsigned i = 0; i < count; i++) {
const TSRange *range = &ranges[i];
if (
range->start_byte < previous_byte ||
range->end_byte < range->start_byte
) return false;
previous_byte = range->end_byte;
}
}
size_t size = count * sizeof(TSRange);
@@ -370,6 +380,7 @@ void ts_lexer_set_included_ranges(
memcpy(self->included_ranges, ranges, size);
self->included_range_count = count;
ts_lexer_goto(self, self->current_position);
return true;
}
TSRange *ts_lexer_included_ranges(const Lexer *self, uint32_t *count) {