Commit 9c2a4ed0c4b72946e615345bee17f015bb1bc26e
- Diff rendering mode:
- inline
- side by side
src/json_scanner.cpp
(11 / 1)
|   | |||
| 278 | 278 | } | |
| 279 | 279 | } | |
| 280 | 280 | else if (isdigit(ch) != 0 && m_quotmarkClosed) { | |
| 281 | *yylval = QVariant(QString::fromLatin1(QByteArray(&ch,1))); | ||
| 281 | qint64 number = atoll(&ch); | ||
| 282 | char nextCh; | ||
| 283 | qint64 ret = m_io->peek(&nextCh, 1); | ||
| 284 | while (ret == 1 && isdigit(nextCh)) { | ||
| 285 | m_io->read(1); //consume | ||
| 286 | yylloc->columns(1); | ||
| 287 | number = number *10 + atoll(&nextCh); | ||
| 288 | ret = m_io->peek(&nextCh, 1); | ||
| 289 | } | ||
| 290 | |||
| 291 | *yylval = QVariant(number); | ||
| 282 | 292 | qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::DIGIT"; | |
| 283 | 293 | return yy::json_parser::token::DIGIT; | |
| 284 | 294 | } |

