Skip to content

Commit 816d960

Browse files
committed
WIP
1 parent 95d4aa4 commit 816d960

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ struct parser_ {
784784
cell v;
785785
stringbuf token_buf;
786786
prolog_flags flags;
787+
query *q;
787788
char *save_line, *srcptr, *error_desc;
788789
size_t token_size, n_line, pos_start;
789790
unsigned line_num, line_num_start;

src/parser.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,6 +2089,9 @@ static cell *goal_expansion(parser *p, cell *goal)
20892089
continue;
20902090

20912091
cell *c = deref(q, &e->c, e->c.val_ctx);
2092+
2093+
// Copy into orig query?
2094+
20922095
q->varnames = true;
20932096
q->max_depth = -1;
20942097
src = print_canonical_to_strbuf(q, c, q->latest_ctx, 1);
@@ -2254,7 +2257,7 @@ static cell *term_to_body_conversion(parser *p, cell *c)
22542257
{
22552258
//printf("*** %s/%u, p->is_command=%d\n", C_STR(p, c), c->arity, p->is_command);
22562259
pl_idx c_idx = c - p->cl->cells;
2257-
bool is_head = (c_idx == 0) && !p->is_command;
2260+
bool is_head = (c_idx == 0) /*&& !p->is_command */;
22582261

22592262
if (is_xfx(c) || is_xfy(c)) {
22602263
if ((c->val_off == g_conjunction_s)
@@ -3760,7 +3763,7 @@ unsigned tokenize(parser *p, bool is_arg_processing, bool is_consing)
37603763

37613764
process_clause(p->m, p->cl, NULL);
37623765

3763-
if (!p->one_shot || p->is_command)
3766+
if (!p->one_shot /*|| p->is_command*/)
37643767
term_to_body(p);
37653768

37663769
if ((p->is_consulting /*|| p->is_command*/) && !p->skip) {
@@ -4402,7 +4405,7 @@ bool run(parser *p, const char *prolog_src, bool dump, query **subq, unsigned in
44024405
p->line_num_start = 0;
44034406
p->line_num = 1;
44044407
p->one_shot = true;
4405-
p->is_command = true;
4408+
//p->is_command = true;
44064409
p->is_consulting = false;
44074410
tokenize(p, false, false);
44084411

0 commit comments

Comments
 (0)