private function parseCompoundVariableOrLiteral()
{
$this->tokenStack->push();
// Read the dollar token
$token = $this->consumeToken(Tokens::T_DOLLAR);
$this->consumeComments();
// Get next token type
$tokenType = $this->tokenizer->peek();
switch ($tokenType) {
case Tokens::T_CURLY_BRACE_OPEN:
$variable = $this->builder->buildAstCompoundVariable($token->image);
$variable->addChild($this->parseCompoundExpression());
break;
default:
$variable = $this->builder->buildAstLiteral($token->image);
break;
}
return $this->setNodePositionsAndReturn($variable);
}