Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Oct 4, 2023
2 parents d98ed0b + 89e0e12 commit 4c3c3f8
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/predicates.c
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,12 @@ static bool fn_iso_clause_2(query *q)
GET_FIRST_ARG(p1,callable);
GET_NEXT_ARG(p2,callable_or_var);

if (p1->val_off == g_colon_s) {
p1 = p1 + 1;
q->st.m = find_module(q->pl, C_STR(q, p1));
p1 += p1->nbr_cells;
}

while (match_clause(q, p1, p1_ctx, DO_CLAUSE)) {
if (q->did_throw) return true;
clause *cl = &q->st.dbe->cl;
Expand Down Expand Up @@ -3588,6 +3594,14 @@ static bool fn_clause_3(query *q)
GET_NEXT_ARG(p2,callable_or_var);
GET_NEXT_ARG(p3,atom_or_var);

if (!is_var(p1)) {
if (p1->val_off == g_colon_s) {
p1 = p1 + 1;
q->st.m = find_module(q->pl, C_STR(q, p1));
p1 += p1->nbr_cells;
}
}

if (is_var(p1) && is_var(p2) && is_var(p3))
return throw_error(q, p3, p3_ctx, "instantiation_error", "args_not_sufficiently_instantiated");

Expand Down Expand Up @@ -3944,10 +3958,16 @@ static void save_name(FILE *fp, query *q, pl_idx name, unsigned arity)

static bool fn_listing_1(query *q)
{
GET_FIRST_ARG(p1,any);
GET_FIRST_ARG(p1,callable);
pl_idx name = p1->val_off;
unsigned arity = -1;

if (p1->val_off == g_colon_s) {
p1 = p1 + 1;
q->st.m = find_module(q->pl, C_STR(q, p1));
p1 += p1->nbr_cells;
}

if (p1->arity) {
if (CMP_STR_TO_CSTR(q, p1, "/") && CMP_STR_TO_CSTR(q, p1, "//"))
return throw_error(q, p1, p1_ctx, "type_error", "predicate_indicator");
Expand Down

0 comments on commit 4c3c3f8

Please sign in to comment.