public functions can now be passed as arguments, with the tag 'Function:'

--HG--
branch : dvander
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/dvander%4015
This commit is contained in:
David Anderson 2006-07-14 06:47:51 +00:00
parent 3f8c9a83ad
commit 9cd64d946c

View File

@ -1670,13 +1670,29 @@ restart:
if (sc_allowproccall) {
callfunction(sym,lval1,FALSE);
} else {
lval1->sym=NULL;
lval1->ident=iEXPRESSION;
lval1->constval=0;
lval1->tag=0;
error(76); /* invalid function call, or syntax error */
} /* if */
return FALSE;
int n=-1,iter=0;
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
if (sym->ident==iFUNCTN
&& (sym->usage & uPUBLIC)!=0 && (sym->usage & uDEFINE)!=0)
{
assert(sym->vclass==sGLOBAL);
if (strcmp(sym->name, lval1->sym->name)==0) {
n = iter;
break;
}
iter++;
}
}
if (n!=-1) {
lval1->sym=NULL;
lval1->ident=iCONSTEXPR;
lval1->constval=n;
lval1->tag=pc_addtag("Function");
} else {
error(76); /* invalid function call, or syntax error */
} /* if */
return FALSE;
}
} /* if */
return lvalue;
}