@@ -36,8 +36,12 @@ discard block |
||
| 36 | 36 | $n--; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if ($n == 0) return false; |
|
| 40 | - if (in_array($str->read($n), ['(', "\n", ' ', '['])) return true; |
|
| 39 | + if ($n == 0) { |
|
| 40 | + return false; |
|
| 41 | + } |
|
| 42 | + if (in_array($str->read($n), ['(', "\n", ' ', '['])) { |
|
| 43 | + return true; |
|
| 44 | + } |
|
| 41 | 45 | |
| 42 | 46 | return false; |
| 43 | 47 | } |
@@ -51,9 +55,13 @@ discard block |
||
| 51 | 55 | } |
| 52 | 56 | |
| 53 | 57 | private function processLiterals($tokens, $name, $str) { |
| 54 | - if (is_numeric($name)) $tokens->add(['type' => Tokenizer::NUMERIC, 'value' => $name]); |
|
| 55 | - else if (method_exists($this, $name)) $this->$name($tokens); |
|
| 56 | - else $tokens->add(['type' => Tokenizer::NAME, 'value' => $name, 'line' => $str->lineNo()]); |
|
| 58 | + if (is_numeric($name)) { |
|
| 59 | + $tokens->add(['type' => Tokenizer::NUMERIC, 'value' => $name]); |
|
| 60 | + } else if (method_exists($this, $name)) { |
|
| 61 | + $this->$name($tokens); |
|
| 62 | + } else { |
|
| 63 | + $tokens->add(['type' => Tokenizer::NAME, 'value' => $name, 'line' => $str->lineNo()]); |
|
| 64 | + } |
|
| 57 | 65 | } |
| 58 | 66 | |
| 59 | 67 | private function true($tokens) { |