You are here

protected function TwigThemeTokenParser::parseArguments in Components! 8

Parses the arguments.

Return value

\Twig_Node_Expression A node expression containing the variables list.

1 call to TwigThemeTokenParser::parseArguments()
TwigThemeTokenParser::parse in src/Template/TwigThemeTokenParser.php

File

src/Template/TwigThemeTokenParser.php, line 33

Class

TwigThemeTokenParser
Generates a render array and renders that.

Namespace

Drupal\components\Template

Code

protected function parseArguments() {
  $stream = $this->parser
    ->getStream();
  $variables = NULL;
  if ($stream
    ->nextIf(\Twig_Token::NAME_TYPE, 'with')) {
    $variables = $this->parser
      ->getExpressionParser()
      ->parseExpression();
  }
  $stream
    ->expect(\Twig_Token::BLOCK_END_TYPE);
  return $variables;
}