Add a benchmark command

This command measures the speed of parsing each grammar's examples.
It also uses each grammar to parse all of the *other* grammars' examples
in order to measure error recovery performance with fairly large files.
This commit is contained in:
Max Brunsfeld 2017-06-21 17:26:52 -07:00
parent 298228d8de
commit 17bc3dfaf7
11 changed files with 191 additions and 11 deletions

View file

@ -310,6 +310,10 @@ bool ts_node_has_changes(TSNode self) {
return ts_node__tree(self)->has_changes;
}
bool ts_node_has_error(TSNode self) {
return ts_node__tree(self)->error_cost > 0;
}
TSNode ts_node_parent(TSNode self) {
TSNode result = self;
uint32_t index;