Require that grammars' start rules be visible

This commit is contained in:
Max Brunsfeld 2017-08-04 15:21:53 -07:00
parent 1dca3a0b58
commit 94dc703bfc
12 changed files with 64 additions and 56 deletions

View file

@ -148,20 +148,11 @@ static Iterator iterator_new(TreePath *path, Tree *tree, const TSLanguage *langu
.child_index = 0,
.structural_child_index = 0,
}));
Iterator self = {
return (Iterator) {
.path = *path,
.language = language,
.visible_depth = 0,
.visible_depth = 1,
};
if (tree->visible) {
self.visible_depth++;
} else {
iterator_descend(&self, length_zero());
}
return self;
}
Length iterator_start_position(Iterator *self) {