/* Call when there is a possibility of a match, either as a final match or as a path within a match  */
static jsonsl_jpr_match_t jsonsl__match_continue(jsonsl_jpr_t jpr, const struct jsonsl_jpr_component_st *component, unsigned prlevel, unsigned chtype)
/* Call when there is a possibility of a match, either as a final match or as a path within a match  */
static jsonsl_jpr_match_t jsonsl__match_continue(jsonsl_jpr_t jpr, const struct jsonsl_jpr_component_st *component, unsigned prlevel, unsigned chtype)
{
    const struct jsonsl_jpr_component_st *next_comp = component + 1;
    if (prlevel == jpr->ncomponents - 1) {
        if (jpr->match_type == 0 || jpr->match_type == chtype) {
            return JSONSL_MATCH_COMPLETE;
        } else {
            return JSONSL_MATCH_TYPE_MISMATCH;
        }
    }
    if (chtype == JSONSL_T_LIST) {
        if (next_comp->ptype == JSONSL_PATH_NUMERIC) {
            return JSONSL_MATCH_POSSIBLE;
        } else {
            return JSONSL_MATCH_TYPE_MISMATCH;
        }
    } else if (chtype == JSONSL_T_OBJECT) {
        if (next_comp->ptype == JSONSL_PATH_NUMERIC) {
            return JSONSL_MATCH_TYPE_MISMATCH;
        } else {
            return JSONSL_MATCH_POSSIBLE;
        }
    } else {
        return JSONSL_MATCH_TYPE_MISMATCH;
    }
}