Esempio n. 1
0
 /**
  * Parse indented block token. 
  * 
  * @return  BlockNode
  */
 protected function parseBlock()
 {
     $node = new BlockNode($this->lexer->getCurrentLine());
     $this->expectTokenType('indent');
     while ('outdent' !== $this->lexer->predictToken()->type) {
         if ('newline' === $this->lexer->predictToken()->type) {
             $this->lexer->getAdvancedToken();
         } else {
             $node->addChild($this->parseExpression());
         }
     }
     $this->expectTokenType('outdent');
     return $node;
 }