| 147 | } |
| 148 | |
| 149 | static inline JsonValue listToValue(JsonTag tag, JsonNode *tail) { |
| 150 | if (tail) { |
| 151 | auto head = tail->next; |
| 152 | tail->next = nullptr; |
| 153 | return JsonValue(tag, head); |
| 154 | } |
| 155 | return JsonValue(tag, nullptr); |
| 156 | } |
| 157 | |
| 158 | int jsonParse(char *s, char **endptr, JsonValue *value, JsonAllocator &allocator) { |
| 159 | JsonNode *tails[JSON_STACK_SIZE]; |