| @@ 132-152 (lines=21) @@ | ||
| 129 | return array($number, $location); |
|
| 130 | } |
|
| 131 | ||
| 132 | private function fractionalPart() |
|
| 133 | { |
|
| 134 | $part = $this->scanner->next(); |
|
| 135 | ||
| 136 | if ($this->scanner->eof()) { |
|
| 137 | throw $this->getError('Expected a digit but instead reached end'); |
|
| 138 | } |
|
| 139 | ||
| 140 | $next = $this->scanner->peek(); |
|
| 141 | if (ctype_digit($next) === false) { |
|
| 142 | throw $this->getError("Expected a digit but instead found \"{$next}\""); |
|
| 143 | } |
|
| 144 | ||
| 145 | $next = $this->scanner->peek(); |
|
| 146 | while ($this->scanner->eof() === false && ctype_digit($next)) { |
|
| 147 | $part .= $this->scanner->next(); |
|
| 148 | $next = $this->scanner->peek(); |
|
| 149 | } |
|
| 150 | ||
| 151 | return $part; |
|
| 152 | } |
|
| 153 | ||
| 154 | private function exponentPart() |
|
| 155 | { |
|
| @@ 165-185 (lines=21) @@ | ||
| 162 | return array($number, $location); |
|
| 163 | } |
|
| 164 | ||
| 165 | private function fractionalPart() |
|
| 166 | { |
|
| 167 | $part = $this->scanner->next(); |
|
| 168 | ||
| 169 | if ($this->scanner->eof()) { |
|
| 170 | throw $this->getError('Expected a digit but instead reached end'); |
|
| 171 | } |
|
| 172 | ||
| 173 | $next = $this->scanner->peek(); |
|
| 174 | if (ctype_digit($next) === false) { |
|
| 175 | throw $this->getError("Expected a digit but instead found \"{$next}\""); |
|
| 176 | } |
|
| 177 | ||
| 178 | $next = $this->scanner->peek(); |
|
| 179 | while ($this->scanner->eof() === false && ctype_digit($next)) { |
|
| 180 | $part .= $this->scanner->next(); |
|
| 181 | $next = $this->scanner->peek(); |
|
| 182 | } |
|
| 183 | ||
| 184 | return $part; |
|
| 185 | } |
|
| 186 | ||
| 187 | private function exponentPart() |
|
| 188 | { |
|