Lines Matching refs:tokens
15 /** @param Token[] $tokens */
16 protected function isKeywordContext(array $tokens, int $pos): bool { argument
17 $prevToken = $this->getPreviousNonSpaceToken($tokens, $pos);
25 public function emulate(string $code, array $tokens): array { argument
27 foreach ($tokens as $i => $token) {
29 && $this->isKeywordContext($tokens, $i)) {
34 return $tokens;
37 /** @param Token[] $tokens */
38 private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token { argument
40 if ($tokens[$i]->id === T_WHITESPACE) {
44 return $tokens[$i];
50 public function reverseEmulate(string $code, array $tokens): array { argument
52 foreach ($tokens as $token) {
58 return $tokens;