From 243217ce29ac8e71d0b3274363cef168f095f1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Dobe=C5=A1?= Date: Fri, 25 Apr 2025 17:52:14 +0200 Subject: [PATCH] Graciously handle yielding SelectedNode --- src/GrammarProcessing/AbstractSyntaxTree.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/GrammarProcessing/AbstractSyntaxTree.php b/src/GrammarProcessing/AbstractSyntaxTree.php index 481d444..dc77ba0 100644 --- a/src/GrammarProcessing/AbstractSyntaxTree.php +++ b/src/GrammarProcessing/AbstractSyntaxTree.php @@ -32,6 +32,10 @@ public function interpret(Interpretation $interpretation): mixed if ($currentGenerator->valid()) { $subnode = $currentGenerator->current(); + if ($subnode instanceof SelectedNode) { + $subnode = $subnode->value; + } + if ($subnode === NULL) { $currentGenerator->send(NULL); } elseif ($subnode instanceof Token) {