Allow lexical debug mode to be enabled on documents

- `ts_document_set_debug(doc, 1)` implies parse debug mode
- `ts_document_set_debug(doc, > 1)` implies parse and lex debug mode
This commit is contained in:
Max Brunsfeld 2014-09-11 13:12:06 -07:00
parent 68d6e242ee
commit e23f11b7c4
4 changed files with 21 additions and 11 deletions

View file

@ -216,7 +216,7 @@ const TSTree *ts_parser_parse(TSParser *parser, TSInput input,
TSInputEdit *edit) {
parser->lookahead = NULL;
parser->next_lookahead = NULL;
parser->lexer = ts_lexer_make();
ts_lexer_reset(&parser->lexer);
parser->lexer.input = input;
input.seek_fn(input.data, breakdown_stack(parser, edit));