Remove state argument to Lexer advance method

This commit is contained in:
Max Brunsfeld 2016-12-05 16:36:34 -08:00
parent c16b6b2059
commit c4fe8ded95
4 changed files with 15 additions and 15 deletions

View file

@ -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)

View file

@ -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;