mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Add null, true, false
This commit is contained in:
@@ -45,7 +45,7 @@ json_object *parse(FILE *f, json_object *current) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isspace(c)) {
|
while (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
|
||||||
c = getc(f);
|
c = getc(f);
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -71,4 +71,28 @@ json_object *parse(FILE *f, json_object *current) {
|
|||||||
|
|
||||||
return current->parent;
|
return current->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c == 'n') {
|
||||||
|
if (getc(f) != 'u' || getc(f) != 'l' || getc(f) != 'l') {
|
||||||
|
json_error("misspelled null");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_object(JSON_NULL, current);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == 't') {
|
||||||
|
if (getc(f) != 'r' || getc(f) != 'u' || getc(f) != 'e') {
|
||||||
|
json_error("misspelled true");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_object(JSON_TRUE, current);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == 'f') {
|
||||||
|
if (getc(f) != 'a' || getc(f) != 'l' || getc(f) != 's' || getc(f) != 'e') {
|
||||||
|
json_error("misspelled false");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new_object(JSON_TRUE, current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user