File tree 1 file changed +7
-4
lines changed 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -988,7 +988,7 @@ class OurReader {
988
988
bool readCppStyleComment ();
989
989
bool readString ();
990
990
bool readStringSingleQuote ();
991
- bool readNumber ();
991
+ bool readNumber (bool checkInf );
992
992
bool readValue ();
993
993
bool readObject (Token& token);
994
994
bool readArray (Token& token);
@@ -1246,8 +1246,11 @@ bool OurReader::readToken(Token& token) {
1246
1246
case ' 7' :
1247
1247
case ' 8' :
1248
1248
case ' 9' :
1249
+ token.type_ = tokenNumber;
1250
+ readNumber (false );
1251
+ break ;
1249
1252
case ' -' :
1250
- if (readNumber ()) {
1253
+ if (readNumber (true )) {
1251
1254
token.type_ = tokenNumber;
1252
1255
} else {
1253
1256
token.type_ = tokenNegInf;
@@ -1382,9 +1385,9 @@ bool OurReader::readCppStyleComment() {
1382
1385
return true ;
1383
1386
}
1384
1387
1385
- bool OurReader::readNumber () {
1388
+ bool OurReader::readNumber (bool checkInf ) {
1386
1389
const char *p = current_;
1387
- if (p != end_ && *p == ' I' ) {
1390
+ if (checkInf && p != end_ && *p == ' I' ) {
1388
1391
current_ = ++p;
1389
1392
return false ;
1390
1393
}
You can’t perform that action at this time.
0 commit comments