| @@ 180-194 (lines=15) @@ | ||
| 177 | * |
|
| 178 | * @return mixed |
|
| 179 | */ |
|
| 180 | protected function parseOrToken() |
|
| 181 | { |
|
| 182 | $x = $this->parseAndToken(); |
|
| 183 | while ($this->peek() === '||') { |
|
| 184 | $this->consume('||'); |
|
| 185 | $y = $this->parseAndToken(); |
|
| 186 | ||
| 187 | if ($this->compileToCode === true) { |
|
| 188 | $x = '(' . $x . ' || ' . $y . ')'; |
|
| 189 | continue; |
|
| 190 | } |
|
| 191 | $x = $this->evaluateOr($x, $y); |
|
| 192 | } |
|
| 193 | return $x; |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * Passes the torch down to the next deeper parsing leve (compare) |
|
| @@ 202-216 (lines=15) @@ | ||
| 199 | * |
|
| 200 | * @return mixed |
|
| 201 | */ |
|
| 202 | protected function parseAndToken() |
|
| 203 | { |
|
| 204 | $x = $this->parseCompareToken(); |
|
| 205 | while ($this->peek() === '&&') { |
|
| 206 | $this->consume('&&'); |
|
| 207 | $y = $this->parseCompareToken(); |
|
| 208 | ||
| 209 | if ($this->compileToCode === true) { |
|
| 210 | $x = '(' . $x . ' && ' . $y . ')'; |
|
| 211 | continue; |
|
| 212 | } |
|
| 213 | $x = $this->evaluateAnd($x, $y); |
|
| 214 | } |
|
| 215 | return $x; |
|
| 216 | } |
|
| 217 | ||
| 218 | /** |
|
| 219 | * Passes the torch down to the next deeper parsing leven (not) |
|