diff options
| author | 2022-09-20 07:46:58 +0200 | |
|---|---|---|
| committer | 2022-09-20 07:46:58 +0200 | |
| commit | 6b4f2d2b3a8ed6b7996dd274860d59876624bc8f (patch) | |
| tree | 0d6899422caad2313368ea38a6cf88c3e8adf7fc /xs_json.h | |
| parent | Added support for bigger codepoints in xs_utf8_enc(). (diff) | |
| download | snac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.tar.gz snac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.tar.xz snac2-6b4f2d2b3a8ed6b7996dd274860d59876624bc8f.zip | |
Some json tweaks.
Diffstat (limited to 'xs_json.h')
| -rw-r--r-- | xs_json.h | 12 |
1 files changed, 5 insertions, 7 deletions
| @@ -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; |