Skip to content

Commit 7243f25

Browse files
Merge pull request #8 from vojtech-dobes/selected-node
Graciously handle yielding SelectedNode
2 parents 266bfd2 + 243217c commit 7243f25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GrammarProcessing/AbstractSyntaxTree.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public function interpret(Interpretation $interpretation): mixed
3232
if ($currentGenerator->valid()) {
3333
$subnode = $currentGenerator->current();
3434

35+
if ($subnode instanceof SelectedNode) {
36+
$subnode = $subnode->value;
37+
}
38+
3539
if ($subnode === NULL) {
3640
$currentGenerator->send(NULL);
3741
} elseif ($subnode instanceof Token) {

0 commit comments

Comments
 (0)