private function parseStaticVariableDeclaration(Token $token)
{
$staticDeclaration = $this->builder->buildAstStaticVariableDeclaration($token->image);
// Strip optional comments
$this->consumeComments();
// Fetch next token type
$tokenType = $this->tokenizer->peek();
while ($tokenType !== Tokenizer::T_EOF) {
$staticDeclaration->addChild($this->parseVariableDeclarator());
$this->consumeComments();
// Semicolon terminates static declaration
$tokenType = $this->tokenizer->peek();
if ($tokenType === Tokens::T_SEMICOLON) {
break;
}
// We are here, so there must be a next declarator
$this->consumeToken(Tokens::T_COMMA);
}
return $staticDeclaration;
}