You are here

protected function Twig_Lexer::lexComment in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Lexer.php \Twig_Lexer::lexComment()
1 call to Twig_Lexer::lexComment()
Twig_Lexer::lexData in vendor/twig/twig/lib/Twig/Lexer.php

File

vendor/twig/twig/lib/Twig/Lexer.php, line 308

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]);
}