function enterPlaceholderValue(PlaceholderValue $node)
 {
     $parent = $node->getParent();
     if (!$parent instanceof SnipCaller) {
         throw new SyntaxErrorException('placeholdervalue must as child of SnipCaller');
     }
 }
Beispiel #2
0
 protected function parsePlaceholderValue($buf)
 {
     $regex = '/
         _(?P<name>\\w+)?  # placeholder with an optional name ( _name )
         /xA';
     if ($buf->match($regex, $match)) {
         $name = array_key_exists('name', $match) ? $match['name'] : '';
         $node = new PlaceholderValue($match['pos'][0], $name);
         $buf->skipWs();
         $node->setSInlineContent($buf->getLine());
         if (null !== ($nested = $this->parseStatement($buf))) {
             //            if (null !== $nested = $this->parseNestableStatement($buf)) {
             $node->setContent($nested);
         }
         return $node;
     }
 }