* Assert that the top of the open-stack is an array. */
| 80 | * Assert that the top of the open-stack is an array. |
| 81 | */ |
| 82 | static void assert_in_array(const struct json_writer *jw) |
| 83 | { |
| 84 | if (!jw->open_stack.len) |
| 85 | BUG("json-writer: array: missing jw_array_begin()"); |
| 86 | if (jw->open_stack.buf[jw->open_stack.len - 1] != '[') |
| 87 | BUG("json-writer: array: not in array"); |
| 88 | } |
| 89 | |
| 90 | /* |
| 91 | * Add comma if we have already seen a member at this level. |