private function parseScope()
{
$scope = $this->builder->buildAstScope();
$this->tokenStack->push();
$this->consumeComments();
$this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
while (($stmt = $this->parseOptionalStatement()) !== null) {
// TODO: Remove if-statement once, we have translated functions and
// closures into ast-nodes
if ($stmt instanceof \PDepend\Source\AST\ASTNode) {
$scope->addChild($stmt);
}
}
$this->consumeComments();
$this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
return $this->setNodePositionsAndReturn($scope);
}