| @@ 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 |
|
| @@ 214-239 (lines=26) @@ | ||
| 211 | return $part; |
|
| 212 | } |
|
| 213 | ||
| 214 | private function number() |
|
| 215 | { |
|
| 216 | list ($integerPart, $location) = $this->integerPart(); |
|
| 217 | if ($this->scanner->eof()) { |
|
| 218 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 219 | return; |
|
| 220 | } |
|
| 221 | ||
| 222 | $next = $this->scanner->peek(); |
|
| 223 | if ($next !== '.' && $next !== 'e' && $next !== 'E') { |
|
| 224 | $this->emit(Token::T_INT, $integerPart, $location); |
|
| 225 | return; |
|
| 226 | } |
|
| 227 | ||
| 228 | $number = $integerPart; |
|
| 229 | if ($next === '.') { |
|
| 230 | $number .= $this->fractionalPart(); |
|
| 231 | } |
|
| 232 | ||
| 233 | $next = $this->scanner->peek(); |
|
| 234 | if ($next === 'e' || $next === 'E') { |
|
| 235 | $number .= $this->exponentPart(); |
|
| 236 | } |
|
| 237 | ||
| 238 | $this->emit(Token::T_FLOAT, $number, $location); |
|
| 239 | } |
|
| 240 | ||
| 241 | /** |
|
| 242 | * @param string $query |
|