Lines Matching refs:tokens
17 public function emulate(string $code, array $tokens): array { argument
20 for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
21 $token = $tokens[$i];
22 …if ($token->text === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1]->id === \T_OBJECT_OPERATOR) {
23 array_splice($tokens, $i, 2, [
31 if ($token->id === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1])
32 && $tokens[$i - 1]->id === \T_VARIABLE
47 array_splice($tokens, $i, 1, $replacement);
53 return $tokens;
56 public function reverseEmulate(string $code, array $tokens): array { argument
58 return $tokens;