return r;
}
+static char *
+insertstars(char *n)
+{
+ Fmt f;
+ int partlen;
+
+ fmtstrinit(&f);
+ partlen = 0;
+ for(; *n != 0; n++){
+ if(*n == ':'){
+ if(partlen == 0)
+ fmtrune(&f, '*');
+ partlen = 0;
+ }else
+ partlen++;
+ fmtrune(&f, *n);
+ }
+ if(partlen == 0)
+ fmtrune(&f, '*');
+ return fmtstrflush(&f);
+}
+
void
clausebegin(void)
{
addprobe(char *s)
{
clause->probs = erealloc(clause->probs, sizeof(char *) * (clause->nprob + 1));
- clause->probs[clause->nprob++] = strdup(s);
+ clause->probs[clause->nprob++] = insertstars(s);
}
static char *aggtypes[] = {
goto again;
case 'x': case 'X': case 'o': case 'b': case 'd':
if(n >= narg) sysfatal("printf() too few arguments");
- if(arg[n]->typ->type != TYPINT) sysfatal("print() %%%c with non-integer", *fmt);
+ if(arg[n]->typ->type != TYPINT)
+ sysfatal("%d: print() %%%c with non-integer", arg[n]->line, *fmt);
arg[n] = tracegen(arg[n], g, recoff);
n++;
fmtrune(&f, 'l');
break;
case 's':
if(n >= narg) sysfatal("printf() too few arguments");
- if(arg[n]->typ->type != TYPSTRING) sysfatal("print() %%s with non-string");
+ if(arg[n]->typ->type != TYPSTRING)
+ sysfatal("%d: print() %%s with non-string", arg[n]->line);
arg[n] = tracegen(arg[n], g, recoff);
n++;
fmtrune(&f, *fmt);