You are here

protected function Twig_Lexer::lexInterpolation in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Lexer.php \Twig_Lexer::lexInterpolation()
  2. 7.2 vendor/Twig/Lexer.php \Twig_Lexer::lexInterpolation()
1 call to Twig_Lexer::lexInterpolation()
Twig_Lexer::tokenize in vendor/Twig/Lexer.php
Tokenizes a source code.

File

vendor/Twig/Lexer.php, line 336

Class

Twig_Lexer
Lexes a template string.

Code

protected function lexInterpolation() {
  $bracket = end($this->brackets);
  if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) {
    array_pop($this->brackets);
    $this
      ->pushToken(Twig_Token::INTERPOLATION_END_TYPE);
    $this
      ->moveCursor($match[0]);
    $this
      ->popState();
  }
  else {
    $this
      ->lexExpression();
  }
}