Lines Matching refs:cursor
26 protected $cursor; variable in Twig\\Lexer
104 $this->cursor = 0;
117 while ($this->cursor < $this->end) {
161 $this->pushToken(Token::TEXT_TYPE, substr($this->code, $this->cursor));
162 $this->cursor = $this->end;
169 while ($position[1] < $this->cursor) {
177 $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor);
191 … if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, null, $this->cursor)) {
195 …} elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, null, $this->cursor)) {
215 …->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, null, $this->cursor)) {
226 …is->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, null, $this->cursor)) {
238 if (preg_match('/\s+/A', $this->code, $match, null, $this->cursor)) {
241 if ($this->cursor >= $this->end) {
247 if (preg_match($this->regexes['operator'], $this->code, $match, null, $this->cursor)) {
252 elseif (preg_match(self::REGEX_NAME, $this->code, $match, null, $this->cursor)) {
257 elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, null, $this->cursor)) {
266 elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) {
268 if (false !== strpos('([{', $this->code[$this->cursor])) {
269 $this->brackets[] = [$this->code[$this->cursor], $this->lineno];
272 elseif (false !== strpos(')]}', $this->code[$this->cursor])) {
274 …throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $thi…
278 if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) {
283 $this->pushToken(Token::PUNCTUATION_TYPE, $this->code[$this->cursor]);
284 ++$this->cursor;
287 elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) {
292 elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
299 …throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->li…
309 … $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
313 $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);
325 …eg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
329 … $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]);
334 … if (preg_match($this->regexes['interpolation_start'], $this->code, $match, null, $this->cursor)) {
339 …} elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && \str…
342 … } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
344 if ('"' != $this->code[$this->cursor]) {
349 ++$this->cursor;
352 …throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->li…
359 …[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) {
381 $this->cursor += \strlen($text);