Remove state argument to Lexer advance method
This commit is contained in:
parent
c16b6b2059
commit
c4fe8ded95
4 changed files with 15 additions and 15 deletions
|
|
@ -46,7 +46,7 @@ static void ts_lexer__get_lookahead(Lexer *self) {
|
|||
LOG_LOOKAHEAD();
|
||||
}
|
||||
|
||||
static void ts_lexer__advance(void *payload, TSStateId state, bool skip) {
|
||||
static void ts_lexer__advance(void *payload, bool skip) {
|
||||
Lexer *self = (Lexer *)payload;
|
||||
if (self->chunk == empty_chunk)
|
||||
return;
|
||||
|
|
@ -63,10 +63,10 @@ static void ts_lexer__advance(void *payload, TSStateId state, bool skip) {
|
|||
}
|
||||
|
||||
if (skip) {
|
||||
LOG("skip_separator state:%d", state);
|
||||
LOG("skip_separator");
|
||||
self->token_start_position = self->current_position;
|
||||
} else {
|
||||
LOG("advance state:%d", state);
|
||||
LOG("advance");
|
||||
}
|
||||
|
||||
if (self->current_position.bytes >= self->chunk_start + self->chunk_size)
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ static Tree *parser__lex(Parser *self, TSStateId parse_state) {
|
|||
self->lexer.data.result_symbol = ts_builtin_sym_error;
|
||||
break;
|
||||
}
|
||||
self->lexer.data.advance(&self->lexer, ERROR_STATE, false);
|
||||
self->lexer.data.advance(&self->lexer, false);
|
||||
}
|
||||
|
||||
skipped_error = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue