public function look($t = 1) { $t--; $length = count($this->tokens); if ($this->cursor + $t > $length) { $t = 0; } if ($this->cursor + $t < 0) { $t = -$this->cursor; } return $this->tokens[$this->cursor + $t]; }