Skip to content

Commit

Permalink
Syntax, re issue #589
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 9, 2024
1 parent fdb8237 commit 3998f63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,11 @@ static bool print_term_to_buf_(query *q, cell *c, pl_idx c_ctx, int running, int
SB_strcatn(q->sb, src, srclen);
if (quote) { SB_sprintf(q->sb, "%s", quote?"' ":""); }

if (!strcmp(src, "\\+"))
q->last_thing = WAS_SYMBOL;
else
q->last_thing = WAS_OTHER;

if (has_visited(visited, rhs, rhs_ctx)) {
if (q->is_dump_vars) {
SB_sprintf(q->sb, "%s", !is_ref(save_rhs) ? C_STR(q, save_rhs) : "_");
Expand Down Expand Up @@ -1282,7 +1287,6 @@ static bool print_term_to_buf_(query *q, cell *c, pl_idx c_ctx, int running, int
me.c = rhs;
me.c_ctx = rhs_ctx;

q->last_thing = WAS_OTHER;
if (parens) { SB_sprintf(q->sb, "%s", "("); q->last_thing = WAS_OTHER; }
q->parens = parens;
print_term_to_buf_(q, rhs, rhs_ctx, running, 0, 0, depth+1, &me);
Expand Down

0 comments on commit 3998f63

Please sign in to comment.