protected function Twig_Lexer::lexComment

1 call to Twig_Lexer::lexComment()
Twig_Lexer::lexData in drupal/core/vendor/twig/twig/lib/Twig/Lexer.php

File

drupal/core/vendor/twig/twig/lib/Twig/Lexer.php, line 305

Class

Twig_Lexer
Lexes a template string.

Code

protected function lexComment() {
  if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
    throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename);
  }
  $this
    ->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor) . $match[0][0]);
}