Show offending lookahead chars when pretty-printing trees w/ errors
This commit is contained in:
parent
844f73c193
commit
2988cc5aa2
5 changed files with 31 additions and 16 deletions
|
|
@ -191,6 +191,8 @@ ts_lr_parser_tree_root(ts_lr_parser *parser) {
|
|||
ts_tree *top_node = ts_stack_top_node(stack);
|
||||
if (stack->size <= 1)
|
||||
return top_node;
|
||||
if (ts_tree_symbol(top_node) == ts_builtin_sym_error)
|
||||
return top_node;
|
||||
|
||||
size_t immediate_child_count;
|
||||
ts_tree **immedate_children = ts_tree_immediate_children(top_node, &immediate_child_count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue