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