Accept . in numbers
This commit is contained in:
@@ -366,7 +366,7 @@ private:
|
||||
if (len == 0) {
|
||||
return false;
|
||||
}
|
||||
if ('0' <= *buf && *buf <= '9') {
|
||||
if ('0' <= *buf && *buf <= '9' || (*buf == '.')) {
|
||||
++buf;
|
||||
--len;
|
||||
} else {
|
||||
@@ -457,14 +457,14 @@ private:
|
||||
}
|
||||
bool parse_number() {
|
||||
char *const bufBefore = buf;
|
||||
if (len == 0 || !('0' <= *buf && *buf <= '9')) {
|
||||
if (len == 0 || !('0' <= *buf && *buf <= '9' || (*buf == '.'))) {
|
||||
return false;
|
||||
}
|
||||
callbacks->on_begin_number(data);
|
||||
++buf;
|
||||
--len;
|
||||
for (;;) {
|
||||
if ('0' <= *buf && *buf <= '9') {
|
||||
if ('0' <= *buf && *buf <= '9' || (*buf == '.')) {
|
||||
++buf;
|
||||
--len;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user