mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-09 03:54:13 +00:00
Comma and colon
This commit is contained in:
parent
f895b8f6b7
commit
50f30c3dd0
18
json.c
18
json.c
@ -95,4 +95,22 @@ json_object *parse(FILE *f, json_object *current) {
|
||||
|
||||
return new_object(JSON_FALSE, current);
|
||||
}
|
||||
|
||||
if (c == ',') {
|
||||
if (current->parent == NULL ||
|
||||
(current->parent->type != JSON_ARRAY ||
|
||||
current->parent->type != JSON_HASH)) {
|
||||
json_error(", not in array or hash");
|
||||
}
|
||||
|
||||
return parse(f, current);
|
||||
}
|
||||
|
||||
if (c == ':') {
|
||||
if (current->parent == NULL || current->parent->type != JSON_HASH) {
|
||||
json_error(": not in hash");
|
||||
}
|
||||
|
||||
return parse(f, current);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user