| @@ 210-235 (lines=26) @@ | ||
| 207 | return $part; |
|
| 208 | } |
|
| 209 | ||
| 210 | private function number() |
|
| 211 | { |
|
| 212 | list ($integerPart, $location) = $this->integerPart(); |
|
| 213 | if ($this->scanner->eof()) { |
|
| 214 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 215 | return; |
|
| 216 | } |
|
| 217 | ||
| 218 | $next = $this->scanner->peek(); |
|
| 219 | if ($next !== '.' && $next !== 'e' && $next !== 'E') { |
|
| 220 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 221 | return; |
|
| 222 | } |
|
| 223 | ||
| 224 | $number = $integerPart; |
|
| 225 | if ($next === '.') { |
|
| 226 | $number .= $this->fractionalPart(); |
|
| 227 | } |
|
| 228 | ||
| 229 | $next = $this->scanner->peek(); |
|
| 230 | if ($next === 'e' || $next === 'E') { |
|
| 231 | $number .= $this->exponentPart(); |
|
| 232 | } |
|
| 233 | ||
| 234 | $this->emit(Token::T_FLOAT, $number, $location); |
|
| 235 | } |
|
| 236 | ||
| 237 | /** |
|
| 238 | * @param string $query |
|
| @@ 181-206 (lines=26) @@ | ||
| 178 | return $part; |
|
| 179 | } |
|
| 180 | ||
| 181 | private function number() |
|
| 182 | { |
|
| 183 | list ($integerPart, $location) = $this->integerPart(); |
|
| 184 | if ($this->scanner->eof()) { |
|
| 185 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 186 | return; |
|
| 187 | } |
|
| 188 | ||
| 189 | $next = $this->scanner->peek(); |
|
| 190 | if ($next !== '.' && $next !== 'e' && $next !== 'E') { |
|
| 191 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 192 | return; |
|
| 193 | } |
|
| 194 | ||
| 195 | $number = $integerPart; |
|
| 196 | if ($next === '.') { |
|
| 197 | $number .= $this->fractionalPart(); |
|
| 198 | } |
|
| 199 | ||
| 200 | $next = $this->scanner->peek(); |
|
| 201 | if ($next === 'e' || $next === 'E') { |
|
| 202 | $number .= $this->exponentPart(); |
|
| 203 | } |
|
| 204 | ||
| 205 | $this->emit(Token::T_FLOAT, $number, $location); |
|
| 206 | } |
|
| 207 | ||
| 208 | /** |
|
| 209 | * @param string $query |
|