update set_included_ranges to modify extent if the current position is at the very beginning of the included range

This commit is contained in:
Cameron Forbis 2021-06-17 16:42:25 -07:00
parent 0fea8c02ee
commit 9182ebef86
2 changed files with 43 additions and 1 deletions

View file

@ -110,7 +110,7 @@ static void ts_lexer_goto(Lexer *self, Length position) {
for (unsigned i = 0; i < self->included_range_count; i++) {
TSRange *included_range = &self->included_ranges[i];
if (included_range->end_byte > position.bytes) {
if (included_range->start_byte > position.bytes) {
if (included_range->start_byte >= position.bytes) {
self->current_position = (Length) {
.bytes = included_range->start_byte,
.extent = included_range->start_point,