diff --git a/src/Neon/Node/LiteralNode.php b/src/Neon/Node/LiteralNode.php index 23b4b32..275987b 100644 --- a/src/Neon/Node/LiteralNode.php +++ b/src/Neon/Node/LiteralNode.php @@ -113,4 +113,13 @@ public function toString(): string throw new \LogicException; } } + + + public function setMemberFlag(): void + { + if(is_string($this->value) && str_starts_with($this->value, '::')){ + $this->value .= '()'; + } + } + } diff --git a/src/Neon/Parser.php b/src/Neon/Parser.php index 827d74c..2525884 100644 --- a/src/Neon/Parser.php +++ b/src/Neon/Parser.php @@ -160,6 +160,7 @@ private function parseEntity(Node $node): Node $this->injectPos($valueNode, $this->stream->getIndex() - 1); if ($this->stream->is('(')) { $attributes = $this->parseBraces(); + $valueNode->setMemberFlag(); $entities[] = $this->injectPos(new Node\EntityNode($valueNode, $attributes->items), $valueNode->startTokenPos, $attributes->endTokenPos); } else { $entities[] = $this->injectPos(new Node\EntityNode($valueNode), $valueNode->startTokenPos);