Expose debug flag on document

This commit is contained in:
Max Brunsfeld 2014-09-06 17:56:00 -07:00
parent c0a3f8d39c
commit 43ecac2a1d
3 changed files with 9 additions and 0 deletions

View file

@ -7,6 +7,7 @@ struct TSDocument {
TSParser parser;
TSInput input;
TSNode *node;
int debug;
};
TSDocument *ts_document_make() { return calloc(sizeof(TSDocument), 1); }
@ -35,9 +36,15 @@ void ts_document_set_language(TSDocument *document,
const TSLanguage *language) {
ts_parser_destroy(&document->parser);
document->parser = ts_parser_make(language);
document->parser.debug = document->debug;
reparse(document, NULL);
}
void ts_document_set_debug(TSDocument *document, int debug) {
document->debug = debug;
document->parser.debug = debug;
}
void ts_document_set_input(TSDocument *document, TSInput input) {
document->input = input;
reparse(document, NULL);