static int parse_pair(JSONParserContext *ctxt, QDict *dict, QList **tokens, va_list *ap)

{

    QObject *key = NULL, *token = NULL, *value, *peek;

    QList *working = qlist_copy(*tokens);



    peek = qlist_peek(working);

    if (peek == NULL) {

        parse_error(ctxt, NULL, "premature EOI");

        goto out;

    }



    key = parse_value(ctxt, &working, ap);

    if (!key || qobject_type(key) != QTYPE_QSTRING) {

        parse_error(ctxt, peek, "key is not a string in object");

        goto out;

    }



    token = qlist_pop(working);

    if (token == NULL) {

        parse_error(ctxt, NULL, "premature EOI");

        goto out;

    }



    if (!token_is_operator(token, ':')) {

        parse_error(ctxt, token, "missing : in object pair");

        goto out;

    }



    value = parse_value(ctxt, &working, ap);

    if (value == NULL) {

        parse_error(ctxt, token, "Missing value in dict");

        goto out;

    }



    qdict_put_obj(dict, qstring_get_str(qobject_to_qstring(key)), value);



    qobject_decref(token);

    qobject_decref(key);

    QDECREF(*tokens);

    *tokens = working;



    return 0;



out:

    qobject_decref(token);

    qobject_decref(key);

    QDECREF(working);



    return -1;

}

static int parse_pair(JSONParserContext *ctxt, QDict *dict, QList **tokens, va_list *ap)

{

    QObject *key = NULL, *token = NULL, *value, *peek;

    QList *working = qlist_copy(*tokens);



    peek = qlist_peek(working);

    if (peek == NULL) {

        parse_error(ctxt, NULL, "premature EOI");

        goto out;

    }



    key = parse_value(ctxt, &working, ap);

    if (!key || qobject_type(key) != QTYPE_QSTRING) {

        parse_error(ctxt, peek, "key is not a string in object");

        goto out;

    }



    token = qlist_pop(working);

    if (token == NULL) {

        parse_error(ctxt, NULL, "premature EOI");

        goto out;

    }



    if (!token_is_operator(token, ':')) {

        parse_error(ctxt, token, "missing : in object pair");

        goto out;

    }



    value = parse_value(ctxt, &working, ap);

    if (value == NULL) {

        parse_error(ctxt, token, "Missing value in dict");

        goto out;

    }



    qdict_put_obj(dict, qstring_get_str(qobject_to_qstring(key)), value);



    qobject_decref(token);

    qobject_decref(key);

    QDECREF(*tokens);

    *tokens = working;



    return 0;



out:

    qobject_decref(token);

    qobject_decref(key);

    QDECREF(working);



    return -1;

}

static int FUNC_0(JSONParserContext *VAR_0, QDict *VAR_1, QList **VAR_2, va_list *VAR_3)

{

    QObject *key = NULL, *token = NULL, *value, *peek;

    QList *working = qlist_copy(*VAR_2);



    peek = qlist_peek(working);

    if (peek == NULL) {

        parse_error(VAR_0, NULL, "premature EOI");

        goto out;

    }



    key = parse_value(VAR_0, &working, VAR_3);

    if (!key || qobject_type(key) != QTYPE_QSTRING) {

        parse_error(VAR_0, peek, "key is not a string in object");

        goto out;

    }



    token = qlist_pop(working);

    if (token == NULL) {

        parse_error(VAR_0, NULL, "premature EOI");

        goto out;

    }



    if (!token_is_operator(token, ':')) {

        parse_error(VAR_0, token, "missing : in object pair");

        goto out;

    }



    value = parse_value(VAR_0, &working, VAR_3);

    if (value == NULL) {

        parse_error(VAR_0, token, "Missing value in VAR_1");

        goto out;

    }



    qdict_put_obj(VAR_1, qstring_get_str(qobject_to_qstring(key)), value);



    qobject_decref(token);

    qobject_decref(key);

    QDECREF(*VAR_2);

    *VAR_2 = working;



    return 0;



out:

    qobject_decref(token);

    qobject_decref(key);

    QDECREF(working);



    return -1;

}

static int FUNC_0(JSONParserContext *VAR_0, QDict *VAR_1, QList **VAR_2, va_list *VAR_3)
{ QObject *key = NULL, *token = NULL, *value, *peek; QList *working = qlist_copy(*VAR_2); peek = qlist_peek(working); if (peek == NULL) { parse_error(VAR_0, NULL, "premature EOI"); goto out; } key = parse_value(VAR_0, &working, VAR_3); if (!key || qobject_type(key) != QTYPE_QSTRING) { parse_error(VAR_0, peek, "key is not a string in object"); goto out; } token = qlist_pop(working); if (token == NULL) { parse_error(VAR_0, NULL, "premature EOI"); goto out; } if (!token_is_operator(token, ':')) { parse_error(VAR_0, token, "missing : in object pair"); goto out; } value = parse_value(VAR_0, &working, VAR_3); if (value == NULL) { parse_error(VAR_0, token, "Missing value in VAR_1"); goto out; } qdict_put_obj(VAR_1, qstring_get_str(qobject_to_qstring(key)), value); qobject_decref(token); qobject_decref(key); QDECREF(*VAR_2); *VAR_2 = working; return 0; out:
qobject_decref(token); qobject_decref(key); QDECREF(working); return -1; }