Lines Matching refs:pos

56      * @param int $pos Position before which the token should occur
61 public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType): bool { argument
63 $pos--;
64 for (; $pos >= 0; $pos--) {
65 $token = $tokens[$pos];
81 * @param int $pos Position after which the token should occur
86 public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType): bool { argument
88 $pos++;
89 for ($c = \count($tokens); $pos < $c; $pos++) {
90 $token = $tokens[$pos];
102 public function skipLeft(int $pos, $skipTokenType): int { argument
105 $pos = $this->skipLeftWhitespace($pos);
107 return $pos;
110 if (!$tokens[$pos]->is($skipTokenType)) {
114 $pos--;
116 return $this->skipLeftWhitespace($pos);
120 public function skipRight(int $pos, $skipTokenType): int { argument
123 $pos = $this->skipRightWhitespace($pos);
125 return $pos;
128 if (!$tokens[$pos]->is($skipTokenType)) {
132 $pos++;
134 return $this->skipRightWhitespace($pos);
140 * @param int $pos Token position
143 public function skipLeftWhitespace(int $pos): int { argument
145 for (; $pos >= 0; $pos--) {
146 if (!$tokens[$pos]->isIgnorable()) {
150 return $pos;
156 * @param int $pos Token position
159 public function skipRightWhitespace(int $pos): int { argument
161 for ($count = \count($tokens); $pos < $count; $pos++) {
162 if (!$tokens[$pos]->isIgnorable()) {
166 return $pos;
170 public function findRight(int $pos, $findTokenType): int { argument
172 for ($count = \count($tokens); $pos < $count; $pos++) {
173 if ($tokens[$pos]->is($findTokenType)) {
174 return $pos;
190 for ($pos = $startPos; $pos < $endPos; $pos++) {
191 if ($tokens[$pos]->is($tokenType)) {
206 * @param int $pos Token position
210 public function getIndentationBefore(int $pos): int { argument
211 return $this->indentMap[$pos];
226 for ($pos = $from; $pos < $to; $pos++) {
227 $token = $tokens[$pos];