| @@ 154-179 (lines=26) @@ | ||
| 151 | return $part; |
|
| 152 | } |
|
| 153 | ||
| 154 | private function exponentPart() |
|
| 155 | { |
|
| 156 | $part = $this->scanner->next(); |
|
| 157 | ||
| 158 | if ($this->scanner->eof()) { |
|
| 159 | throw $this->getError('Expected a digit but instead reached end'); |
|
| 160 | } |
|
| 161 | ||
| 162 | $next = $this->scanner->peek(); |
|
| 163 | if ($next === '+' || $next === '-') { |
|
| 164 | $part .= $this->scanner->next(); |
|
| 165 | } |
|
| 166 | ||
| 167 | $next = $this->scanner->peek(); |
|
| 168 | if (ctype_digit($next) === false) { |
|
| 169 | throw $this->getError("Expected a digit but instead found \"{$next}\""); |
|
| 170 | } |
|
| 171 | ||
| 172 | $next = $this->scanner->peek(); |
|
| 173 | while ($this->scanner->eof() === false && ctype_digit($next)) { |
|
| 174 | $part .= $this->scanner->next(); |
|
| 175 | $next = $this->scanner->peek(); |
|
| 176 | } |
|
| 177 | ||
| 178 | return $part; |
|
| 179 | } |
|
| 180 | ||
| 181 | private function number() |
|
| 182 | { |
|
| @@ 187-212 (lines=26) @@ | ||
| 184 | return $part; |
|
| 185 | } |
|
| 186 | ||
| 187 | private function exponentPart() |
|
| 188 | { |
|
| 189 | $part = $this->scanner->next(); |
|
| 190 | ||
| 191 | if ($this->scanner->eof()) { |
|
| 192 | throw $this->getError('Expected a digit but instead reached end'); |
|
| 193 | } |
|
| 194 | ||
| 195 | $next = $this->scanner->peek(); |
|
| 196 | if ($next === '+' || $next === '-') { |
|
| 197 | $part .= $this->scanner->next(); |
|
| 198 | } |
|
| 199 | ||
| 200 | $next = $this->scanner->peek(); |
|
| 201 | if (ctype_digit($next) === false) { |
|
| 202 | throw $this->getError("Expected a digit but instead found \"{$next}\""); |
|
| 203 | } |
|
| 204 | ||
| 205 | $next = $this->scanner->peek(); |
|
| 206 | while ($this->scanner->eof() === false && ctype_digit($next)) { |
|
| 207 | $part .= $this->scanner->next(); |
|
| 208 | $next = $this->scanner->peek(); |
|
| 209 | } |
|
| 210 | ||
| 211 | return $part; |
|
| 212 | } |
|
| 213 | ||
| 214 | private function number() |
|
| 215 | { |
|