Rename .read_fn, .seek_fn -> .read, .seek
This commit is contained in:
parent
f6da44fdbb
commit
38241d466b
6 changed files with 11 additions and 11 deletions
|
|
@ -90,7 +90,7 @@ void ts_document_edit(TSDocument *self, TSInputEdit edit) {
|
|||
}
|
||||
|
||||
int ts_document_parse(TSDocument *self) {
|
||||
if (!self->input.read_fn || !self->parser.language)
|
||||
if (!self->input.read || !self->parser.language)
|
||||
return -1;
|
||||
|
||||
TSTree *reusable_tree = self->valid ? self->tree : NULL;
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ 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.chars,
|
||||
input.seek(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);
|
||||
self->chunk = input.read(input.payload, &self->chunk_size);
|
||||
if (!self->chunk_size)
|
||||
self->chunk = empty_chunk;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ TSInput ts_string_input_make(const char *string) {
|
|||
input->length = strlen(string);
|
||||
return (TSInput){
|
||||
.payload = input,
|
||||
.read_fn = ts_string_input_read,
|
||||
.seek_fn = ts_string_input_seek,
|
||||
.read = ts_string_input_read,
|
||||
.seek = ts_string_input_seek,
|
||||
.encoding = TSInputEncodingUTF8,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue