@@ 217-229 (lines=13) @@ | ||
214 | * |
|
215 | * @return array|string|false |
|
216 | */ |
|
217 | public function lookahead() |
|
218 | { |
|
219 | $i = $this->offset; |
|
220 | while (++$i < $this->cnt) |
|
221 | { |
|
222 | if (isset($this->tokens[$i])) |
|
223 | { |
|
224 | return $this->tokens[$i]; |
|
225 | } |
|
226 | } |
|
227 | ||
228 | return false; |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * Peek at the previous token |
|
@@ 236-248 (lines=13) @@ | ||
233 | * |
|
234 | * @return array|string|false |
|
235 | */ |
|
236 | public function lookbehind() |
|
237 | { |
|
238 | $i = $this->offset; |
|
239 | while (--$i >= 0) |
|
240 | { |
|
241 | if (isset($this->tokens[$i])) |
|
242 | { |
|
243 | return $this->tokens[$i]; |
|
244 | } |
|
245 | } |
|
246 | ||
247 | return false; |
|
248 | } |
|
249 | ||
250 | /** |
|
251 | * Move to the next token in the stream |