Make the empty chunk 2 bytes long, for UTF16 support
This commit is contained in:
parent
4f5a87b952
commit
80cab8fd8a
2 changed files with 25 additions and 3 deletions
|
|
@ -14,7 +14,7 @@
|
|||
#define LOG_CHARACTER(message, character) \
|
||||
LOG(character < 255 ? message " character:'%c'" : message " character:%d", character)
|
||||
|
||||
static const char empty_chunk[2] = { 0, 0 };
|
||||
static const char empty_chunk[3] = { 0, 0 };
|
||||
|
||||
static void ts_lexer__get_chunk(Lexer *self) {
|
||||
self->chunk_start = self->current_position.bytes;
|
||||
|
|
@ -186,7 +186,7 @@ static void ts_lexer_goto(Lexer *self, Length position) {
|
|||
};
|
||||
self->chunk = empty_chunk;
|
||||
self->chunk_start = position.bytes;
|
||||
self->chunk_size = 1;
|
||||
self->chunk_size = 2;
|
||||
}
|
||||
|
||||
self->token_start_position = position;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue