| @@ 161-181 (lines=21) @@ | ||
| 158 | return array($number, $location); |
|
| 159 | } |
|
| 160 | ||
| 161 | private function fractionalPart() |
|
| 162 | { |
|
| 163 | $part = $this->scanner->next(); |
|
| 164 | ||
| 165 | if ($this->scanner->eof()) { |
|
| 166 | throw $this->getError('Expected a digit but instead reached end'); |
|
| 167 | } |
|
| 168 | ||
| 169 | $next = $this->scanner->peek(); |
|
| 170 | if (ctype_digit($next) === false) { |
|
| 171 | throw $this->getError("Expected a digit but instead found \"{$next}\""); |
|
| 172 | } |
|
| 173 | ||
| 174 | $next = $this->scanner->peek(); |
|
| 175 | while ($this->scanner->eof() === false && ctype_digit($next)) { |
|
| 176 | $part .= $this->scanner->next(); |
|
| 177 | $next = $this->scanner->peek(); |
|
| 178 | } |
|
| 179 | ||
| 180 | return $part; |
|
| 181 | } |
|
| 182 | ||
| 183 | private function exponentPart() |
|
| 184 | { |
|
| @@ 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 | { |
|