Skip to content

Commit

Permalink
Confusion, re issue #584
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 6, 2024
1 parent c9ae181 commit f935af4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,9 @@ static rule *assert_begin(module *m, unsigned nbr_vars, cell *p1, bool consultin
if (!c || !m)
return NULL;

if (is_cstring(c))
convert_to_literal(m, c);

predicate *pr = find_predicate(m, c);

if (pr && !consulting && !pr->is_dynamic)
Expand Down
7 changes: 3 additions & 4 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ unsigned tokenize(parser *p, bool args, bool consing)
{
pl_idx arg_idx = p->cl->cidx, save_idx = 0;
bool last_op = true, is_func = false, last_num = false;
bool last_bar = false, last_quoted = false;
bool last_bar = false;
bool last_prefix = false, last_postfix = false;
int entered = p->entered;
unsigned arity = 1;
Expand Down Expand Up @@ -3861,7 +3861,7 @@ unsigned tokenize(parser *p, bool args, bool consing)
priority = 0;
}

if (priority && IS_INFIX(specifier) && last_op && !last_postfix && !last_quoted) {
if (priority && IS_INFIX(specifier) && last_op && !last_postfix) {
specifier = 0;
priority = 0;
}
Expand Down Expand Up @@ -3919,7 +3919,6 @@ unsigned tokenize(parser *p, bool args, bool consing)
break;
}

last_quoted = p->is_quoted;
last_op = SB_strcmp(p->token, ")") && priority;
last_postfix = last_op && IS_POSTFIX(specifier);
last_prefix = last_op && IS_PREFIX(specifier);
Expand All @@ -3942,7 +3941,7 @@ unsigned tokenize(parser *p, bool args, bool consing)
set_float(c, get_float(&p->v));
} else if (!p->is_string && (!p->is_quoted || is_func || p->is_op || p->is_var
|| (get_builtin(p->m->pl, SB_cstr(p->token), SB_strlen(p->token), 0, &found, NULL), found)
|| (p->is_quoted && !SB_strcmp(p->token, "[]"))
|| !SB_strcmp(p->token, "[]")
)) {

if (is_func && !SB_strcmp(p->token, "."))
Expand Down

0 comments on commit f935af4

Please sign in to comment.