Lines Matching refs:cursor

26     private $cursor;  variable in Twig\\Lexer
160 $this->cursor = 0;
173 while ($this->cursor < $this->end) {
213 $this->pushToken(/* Token::TEXT_TYPE */ 0, substr($this->code, $this->cursor));
214 $this->cursor = $this->end;
221 while ($position[1] < $this->cursor) {
229 $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor);
252 … if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, 0, $this->cursor)) {
256 … } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, 0, $this->cursor)) {
276 …his->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, 0, $this->cursor)) {
287 …$this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, 0, $this->cursor)) {
299 if (preg_match('/\s+/A', $this->code, $match, 0, $this->cursor)) {
302 if ($this->cursor >= $this->end) {
308 if ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) {
313 elseif (preg_match($this->regexes['operator'], $this->code, $match, 0, $this->cursor)) {
318 elseif (preg_match(self::REGEX_NAME, $this->code, $match, 0, $this->cursor)) {
323 elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) {
332 elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) {
334 if (false !== strpos('([{', $this->code[$this->cursor])) {
335 $this->brackets[] = [$this->code[$this->cursor], $this->lineno];
338 elseif (false !== strpos(')]}', $this->code[$this->cursor])) {
340 …throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $thi…
344 if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) {
349 $this->pushToken(/* Token::PUNCTUATION_TYPE */ 9, $this->code[$this->cursor]);
350 ++$this->cursor;
353 elseif (preg_match(self::REGEX_STRING, $this->code, $match, 0, $this->cursor)) {
358 elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) {
365 …throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->li…
371 …_match($this->regexes['lex_raw_data'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) {
375 $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);
395 …g_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) {
399 … $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]);
404 … if (preg_match($this->regexes['interpolation_start'], $this->code, $match, 0, $this->cursor)) {
409 …} elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && \strlen…
412 } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) {
414 if ('"' != $this->code[$this->cursor]) {
419 ++$this->cursor;
422 …throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->li…
429 …ket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, 0, $this->cursor)) {
451 $this->cursor += \strlen($text);