summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2022-09-20 07:46:58 +0200
committerGravatar default2022-09-20 07:46:58 +0200
commit6b4f2d2b3a8ed6b7996dd274860d59876624bc8f (patch)
tree0d6899422caad2313368ea38a6cf88c3e8adf7fc
parentAdded support for bigger codepoints in xs_utf8_enc(). (diff)
downloadsnac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.tar.gz
snac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.tar.xz
snac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.zip
Some json tweaks.
-rw-r--r--xs_json.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/xs_json.h b/xs_json.h
index 53b1d20..f529b47 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -372,7 +372,7 @@ d_char *_xs_json_loads_array(const char **json, js_type *t)
372 l = xs_list_append(l, v); 372 l = xs_list_append(l, v);
373 373
374 while (*t == JS_INCOMPLETE) { 374 while (*t == JS_INCOMPLETE) {
375 _xs_json_loads_lexer(&s, &tt); 375 xs *v1 = _xs_json_loads_lexer(&s, &tt);
376 376
377 if (tt == JS_CBRACK) 377 if (tt == JS_CBRACK)
378 *t = JS_ARRAY; 378 *t = JS_ARRAY;
@@ -425,7 +425,7 @@ d_char *_xs_json_loads_object(const char **json, js_type *t)
425 *t = JS_OBJECT; 425 *t = JS_OBJECT;
426 else 426 else
427 if (tt == JS_STRING) { 427 if (tt == JS_STRING) {
428 _xs_json_loads_lexer(&s, &tt); 428 xs *t1 = _xs_json_loads_lexer(&s, &tt);
429 429
430 if (tt == JS_COLON) { 430 if (tt == JS_COLON) {
431 xs *v1; 431 xs *v1;
@@ -437,18 +437,16 @@ d_char *_xs_json_loads_object(const char **json, js_type *t)
437 d = xs_dict_append(d, k1, v1); 437 d = xs_dict_append(d, k1, v1);
438 438
439 while (*t == JS_INCOMPLETE) { 439 while (*t == JS_INCOMPLETE) {
440 _xs_json_loads_lexer(&s, &tt); 440 xs *t2 = _xs_json_loads_lexer(&s, &tt);
441 441
442 if (tt == JS_CCURLY) 442 if (tt == JS_CCURLY)
443 *t = JS_OBJECT; 443 *t = JS_OBJECT;
444 else 444 else
445 if (tt == JS_COMMA) { 445 if (tt == JS_COMMA) {
446 xs *k; 446 xs *k = _xs_json_loads_lexer(&s, &tt);
447
448 k = _xs_json_loads_lexer(&s, &tt);
449 447
450 if (tt == JS_STRING) { 448 if (tt == JS_STRING) {
451 _xs_json_loads_lexer(&s, &tt); 449 xs *t3 = _xs_json_loads_lexer(&s, &tt);
452 450
453 if (tt == JS_COLON) { 451 if (tt == JS_COLON) {
454 xs *v; 452 xs *v;