| @@ 182-194 (lines=13) @@ | ||
| 179 | * Do NOT use $token, as that variable is also a reference |
|
| 180 | * @return bool |
|
| 181 | */ |
|
| 182 | protected function forward(&$i, &$current) |
|
| 183 | { |
|
| 184 | if ($i === null) { |
|
| 185 | $i = count($this->inputZipper->back) - 1; |
|
| 186 | } else { |
|
| 187 | $i--; |
|
| 188 | } |
|
| 189 | if ($i < 0) { |
|
| 190 | return false; |
|
| 191 | } |
|
| 192 | $current = $this->inputZipper->back[$i]; |
|
| 193 | return true; |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * Similar to _forward, but accepts a third parameter $nesting (which |
|
| @@ 236-248 (lines=13) @@ | ||
| 233 | * Do NOT use $token, as that variable is also a reference |
|
| 234 | * @return bool |
|
| 235 | */ |
|
| 236 | protected function backward(&$i, &$current) |
|
| 237 | { |
|
| 238 | if ($i === null) { |
|
| 239 | $i = count($this->inputZipper->front) - 1; |
|
| 240 | } else { |
|
| 241 | $i--; |
|
| 242 | } |
|
| 243 | if ($i < 0) { |
|
| 244 | return false; |
|
| 245 | } |
|
| 246 | $current = $this->inputZipper->front[$i]; |
|
| 247 | return true; |
|
| 248 | } |
|
| 249 | ||
| 250 | /** |
|
| 251 | * Handler that is called when a text token is processed |
|