Fix handling of zero-width external tokens at beginning of document

Fixes #316
This commit is contained in:
Max Brunsfeld 2019-04-08 15:01:52 -07:00
parent 701d63dab7
commit bc5e71bcc2
4 changed files with 64 additions and 0 deletions

View file

@ -583,6 +583,7 @@ int ts_stack_dynamic_precedence(Stack *self, StackVersion version) {
bool ts_stack_has_advanced_since_error(const Stack *self, StackVersion version) {
const StackHead *head = array_get(&self->heads, version);
const StackNode *node = head->node;
if (node->error_cost == 0) return true;
while (node) {
if (node->link_count > 0) {
Subtree subtree = node->links[0].subtree;