Fixed for empty parameter lists
This commit is contained in:
parent
8c66b84305
commit
7e30c7d648
1 changed files with 13 additions and 4 deletions
|
@ -214,11 +214,13 @@ rule { register p_nont p;
|
|||
p->n_lineno = linecount;
|
||||
p->n_off = ftell(fact);
|
||||
}
|
||||
[ params { p->n_flags |= PARAMS;
|
||||
if (nparams > 15) {
|
||||
error(linecount,"Too many parameters");
|
||||
[ params { if (nparams > 0) {
|
||||
p->n_flags |= PARAMS;
|
||||
if (nparams > 15) {
|
||||
error(linecount,"Too many parameters");
|
||||
}
|
||||
else setntparams(p,nparams);
|
||||
}
|
||||
else setntparams(p,nparams);
|
||||
}
|
||||
]?
|
||||
[ action(0) { p->n_flags |= LOCALS; }
|
||||
|
@ -496,8 +498,15 @@ elem (register p_gram pres;)
|
|||
;
|
||||
|
||||
params
|
||||
{
|
||||
long off = ftell(fact);
|
||||
}
|
||||
: '(' { copyact('(',')',0,0); }
|
||||
')'
|
||||
{ if (nparams == 0) {
|
||||
fseek(fact, off, 0);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
expr : '(' { copyact('(',')',1,0); }
|
||||
|
|
Loading…
Reference in a new issue