/** * Parse next commend token. * * @return CommentNode */ protected function parseComment() { $token = $this->expectTokenType('comment'); $node = new CommentNode(preg_replace('/^ +| +$/', '', $token->value), $token->buffer, $this->lexer->getCurrentLine()); // Skip newlines while ($this->lexer->predictToken()->type === 'newline') { $this->lexer->getAdvancedToken(); } if ($this->lexer->predictToken()->type === 'indent') { $node->setBlock($this->parseBlock()); } return $node; }