mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Some json tweaks.
This commit is contained in:
parent
0b69c9abe1
commit
6b4f2d2b3a
1 changed files with 5 additions and 7 deletions
12
xs_json.h
12
xs_json.h
|
@ -372,7 +372,7 @@ d_char *_xs_json_loads_array(const char **json, js_type *t)
|
||||||
l = xs_list_append(l, v);
|
l = xs_list_append(l, v);
|
||||||
|
|
||||||
while (*t == JS_INCOMPLETE) {
|
while (*t == JS_INCOMPLETE) {
|
||||||
_xs_json_loads_lexer(&s, &tt);
|
xs *v1 = _xs_json_loads_lexer(&s, &tt);
|
||||||
|
|
||||||
if (tt == JS_CBRACK)
|
if (tt == JS_CBRACK)
|
||||||
*t = JS_ARRAY;
|
*t = JS_ARRAY;
|
||||||
|
@ -425,7 +425,7 @@ d_char *_xs_json_loads_object(const char **json, js_type *t)
|
||||||
*t = JS_OBJECT;
|
*t = JS_OBJECT;
|
||||||
else
|
else
|
||||||
if (tt == JS_STRING) {
|
if (tt == JS_STRING) {
|
||||||
_xs_json_loads_lexer(&s, &tt);
|
xs *t1 = _xs_json_loads_lexer(&s, &tt);
|
||||||
|
|
||||||
if (tt == JS_COLON) {
|
if (tt == JS_COLON) {
|
||||||
xs *v1;
|
xs *v1;
|
||||||
|
@ -437,18 +437,16 @@ d_char *_xs_json_loads_object(const char **json, js_type *t)
|
||||||
d = xs_dict_append(d, k1, v1);
|
d = xs_dict_append(d, k1, v1);
|
||||||
|
|
||||||
while (*t == JS_INCOMPLETE) {
|
while (*t == JS_INCOMPLETE) {
|
||||||
_xs_json_loads_lexer(&s, &tt);
|
xs *t2 = _xs_json_loads_lexer(&s, &tt);
|
||||||
|
|
||||||
if (tt == JS_CCURLY)
|
if (tt == JS_CCURLY)
|
||||||
*t = JS_OBJECT;
|
*t = JS_OBJECT;
|
||||||
else
|
else
|
||||||
if (tt == JS_COMMA) {
|
if (tt == JS_COMMA) {
|
||||||
xs *k;
|
xs *k = _xs_json_loads_lexer(&s, &tt);
|
||||||
|
|
||||||
k = _xs_json_loads_lexer(&s, &tt);
|
|
||||||
|
|
||||||
if (tt == JS_STRING) {
|
if (tt == JS_STRING) {
|
||||||
_xs_json_loads_lexer(&s, &tt);
|
xs *t3 = _xs_json_loads_lexer(&s, &tt);
|
||||||
|
|
||||||
if (tt == JS_COLON) {
|
if (tt == JS_COLON) {
|
||||||
xs *v;
|
xs *v;
|
||||||
|
|
Loading…
Reference in a new issue