Allow room in parse table for error and EOF entries

This commit is contained in:
Max Brunsfeld 2014-03-18 08:04:17 -07:00
parent 67b33a615b
commit 8e7f59db1c
5 changed files with 140 additions and 137 deletions

View file

@ -79,10 +79,10 @@ size_t ts_tree_child_count(const ts_tree *tree) {
return tree->data.children.count;
}
static const char *NULL_TREE_STRING = "(NULL)";
static const char *ERROR_TREE_STRING = "(ERROR)";
static size_t tree_write_to_string(const ts_tree *tree, const char **symbol_names, char *string, size_t limit) {
static const char *NULL_TREE_STRING = "(NULL)";
static const char *ERROR_TREE_STRING = "(ERROR)";
if (!tree)
return snprintf(string, limit, "%s", NULL_TREE_STRING);
if (tree->symbol == ts_builtin_sym_error)