Validation for empty objects
Now (correctly) fails to parse {,}
This commit is contained in:
1 parent
e98624e5a9
commit
22f8aed31e
3 files changed
+19
-1
No files matched your search
+2
-1
@@ -100,7 +100,8 @@ pfunc token(char ch) {
|
||||
} else {
|
||||
if (jv_get_kind(stack[stackpos-1]) != JV_KIND_OBJECT)
|
||||
return "Unmatched '}'";
|
||||
// FIXME: assert object empty
|
||||
if (jv_object_length(jv_copy(stack[stackpos-1])) != 0)
|
||||
return "Expected another key-value pair";
|
||||
}
|
||||
hasnext = 1;
|
||||
next = stack[--stackpos];
|
||||
|
||||
Reference in new issue
Block a user