/**
* Parses expressions such as '$username'.
*
* {@inheritdoc}
*
* @throws ParseException
*/
public function parse(Token $token)
{
try {
return new VariableValue(substr($token->getValue(), 1));
} catch (\TypeError $error) {
throw ExpressionLanguageExceptionFactory::createForUnparsableToken($token, 0, $error);
}
}