Use individual args instead of TSLength in input seek function

This commit is contained in:
Max Brunsfeld 2015-12-03 23:06:01 -08:00
parent b3a6de6dad
commit 8e217f758c
5 changed files with 8 additions and 8 deletions

View file

@ -24,7 +24,7 @@ static void ts_lexer__get_chunk(TSLexer *self) {
TSInput input = self->input;
if (!self->chunk ||
self->current_position.bytes != self->chunk_start + self->chunk_size)
input.seek_fn(input.payload, self->current_position);
input.seek_fn(input.payload, self->current_position.chars, self->current_position.bytes);
self->chunk_start = self->current_position.bytes;
self->chunk = input.read_fn(input.payload, &self->chunk_size);

View file

@ -19,10 +19,10 @@ const char *ts_string_input_read(void *payload, size_t *bytes_read) {
return input->string + previous_position;
}
int ts_string_input_seek(void *payload, TSLength position) {
int ts_string_input_seek(void *payload, size_t character, size_t byte) {
TSStringInput *input = (TSStringInput *)payload;
input->position = position.bytes;
return (position.bytes < input->length);
input->position = byte;
return (byte < input->length);
}
TSInput ts_string_input_make(const char *string) {