Reset lexer correctly when old input was blank

This commit is contained in:
Max Brunsfeld 2015-12-03 10:00:39 -08:00
parent e32fe07432
commit 8a146a9bef
4 changed files with 28 additions and 6 deletions

View file

@ -342,8 +342,7 @@ static void ts_parser__start(TSParser *self, TSInput input,
LOG("new_parse");
}
self->lexer.input = input;
ts_lexer_reset(&self->lexer, ts_length_zero(), ts_point_zero());
ts_lexer_set_input(&self->lexer, input);
ts_stack_clear(self->stack);
LookaheadState head_state = {