Home
last modified time | relevance | path

Searched refs:pos (Results 1 – 19 of 19) sorted by relevance

/PHP-Parser/lib/PhpParser/Internal/
H A DTokenStream.php63 $pos--;
64 for (; $pos >= 0; $pos--) {
88 $pos++;
89 for ($c = \count($tokens); $pos < $c; $pos++) {
105 $pos = $this->skipLeftWhitespace($pos);
114 $pos--;
123 $pos = $this->skipRightWhitespace($pos);
132 $pos++;
145 for (; $pos >= 0; $pos--) {
190 for ($pos = $startPos; $pos < $endPos; $pos++) {
[all …]
H A DTokenPolyfill.php26 public int $pos; variable in PhpParser\\Internal\\TokenPolyfill
46 $this->pos = $pos;
129 $pos = 0;
139 $pos += 2;
142 $pos++;
154 $tokens[] = new static($id, $text, $line, $pos);
155 $pos += \strlen($text);
165 $pos += \strlen($trailingNewline);
203 $pos += \strlen($newText);
209 $tokens[] = new static($id, $text, $line, $pos);
[all …]
/PHP-Parser/lib/PhpParser/NodeVisitor/
H A DCommentAnnotatingVisitor.php12 private int $pos = 0; variable in PhpParser\\NodeVisitor\\CommentAnnotatingVisitor
42 $oldPos = $this->pos;
43 $this->pos = $pos = $node->getStartTokenPos();
44 if ($nextCommentPos > $oldPos && $nextCommentPos < $pos) {
46 while (--$pos >= $oldPos) {
47 $token = $this->tokens[$pos];
50 $token->text, $token->line, $token->pos, $pos,
51 $token->getEndLine(), $token->getEndPos() - 1, $pos);
56 $token->text, $token->line, $token->pos, $pos,
57 $token->getEndLine(), $token->getEndPos() - 1, $pos);
[all …]
/PHP-Parser/lib/PhpParser/Lexer/TokenEmulator/
H A DReadonlyTokenEmulator.php20 protected function isKeywordContext(array $tokens, int $pos): bool { argument
21 if (!parent::isKeywordContext($tokens, $pos)) {
25 return !(isset($tokens[$pos + 1]) &&
26 ($tokens[$pos + 1]->text === '(' ||
27 ($tokens[$pos + 1]->id === \T_WHITESPACE &&
28 isset($tokens[$pos + 2]) &&
29 $tokens[$pos + 2]->text === '(')));
H A DAttributeEmulator.php24 new Token(\T_ATTRIBUTE, '#[', $token->line, $token->pos),
40 $pos = 0;
41 while (false !== $pos = strpos($code, '#[', $pos)) {
43 $code[$pos] = '%';
44 $patches[] = [$pos, 'replace', '#'];
45 $pos += 2;
H A DEnumTokenEmulator.php20 protected function isKeywordContext(array $tokens, int $pos): bool { argument
21 return parent::isKeywordContext($tokens, $pos)
22 && isset($tokens[$pos + 2])
23 && $tokens[$pos + 1]->id === \T_WHITESPACE
24 && $tokens[$pos + 2]->id === \T_STRING;
H A DNullsafeTokenEmulator.php24 new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),
36 new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),
37 new Token(\T_STRING, $matches[1], $token->line, $token->pos + 3),
44 $token->line, $token->pos + $matchLen
H A DKeywordEmulator.php16 protected function isKeywordContext(array $tokens, int $pos): bool { argument
17 $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos);
H A DExplicitOctalEmulator.php26 new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos),
/PHP-Parser/lib/PhpParser/
H A DError.php144 * @param int $pos 0-based position in $code
148 private function toColumn(string $code, int $pos): int { argument
149 if ($pos > strlen($code)) {
153 $lineStartPos = strrpos($code, "\n", $pos - strlen($code));
158 return $pos - $lineStartPos;
H A DLexer.php55 'startFilePos' => $token->pos,
56 'endFilePos' => $token->pos,
108 'startFilePos' => $lastToken->pos,
H A DToken.php11 return $this->pos + \strlen($this->text);
H A DPrettyPrinterAbstract.php543 $pos = 0;
616 $pos = $startPos;
651 $pos = $this->origTokens->findRight($pos, $findToken);
731 $pos = $subEndPos + 1;
901 $itemStartPos = $pos;
902 $itemEndPos = $pos - 1;
960 $pos = $itemEndPos + 1;
977 $pos = $insertPos;
1218 $pos = -1;
1225 if ($pos >= 0) {
[all …]
H A DNodeDumper.php278 private function toColumn(string $code, int $pos): int { argument
279 if ($pos > strlen($code)) {
283 $lineStartPos = strrpos($code, "\n", $pos - strlen($code));
288 return $pos - $lineStartPos;
H A DParserAbstract.php485 'startFilePos' => $startToken->pos,
488 'endFilePos' => $afterEndToken->pos - 1,
507 'startFilePos' => $token->pos,
510 'endFilePos' => $token->pos,
894 ? new Comment\Doc($token->text, $token->line, $token->pos, $tokenPos,
896 : new Comment($token->text, $token->line, $token->pos, $tokenPos,
/PHP-Parser/lib/PhpParser/Node/
H A DName.php52 if (false !== $pos = \strpos($this->name, '\\')) {
53 return \substr($this->name, 0, $pos);
64 if (false !== $pos = \strrpos($this->name, '\\')) {
65 return \substr($this->name, $pos + 1);
178 if (false !== $pos = \strpos($this->name, '\\')) {
179 return new static(\substr($this->name, $pos + 1));
/PHP-Parser/lib/PhpParser/Lexer/
H A DEmulative.php139 $pos = $token->pos;
140 $token->pos += $posDelta;
144 while ($patchPos >= $pos && $patchPos < $pos + $len) {
147 if ($patchPos === $pos && $patchTextLen === $len) {
155 $token->text, '', $patchPos - $pos + $localPosDelta, $patchTextLen
163 $token->text, $patchText, $patchPos - $pos + $localPosDelta, 0
170 $token->text, $patchText, $patchPos - $pos + $localPosDelta, $patchTextLen
/PHP-Parser/doc/component/
H A DLexer.markdown52 public int $pos;
/PHP-Parser/
H A DUPGRADE-5.0.md482 public int $pos;

Completed in 47 milliseconds