mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user