--- ray/src/common/caldefn.c 1995/02/17 18:34:42 2.8 +++ ray/src/common/caldefn.c 1997/01/08 17:10:24 2.10 @@ -55,7 +55,7 @@ static EPNODE *outchan; #endif #ifdef FUNCTION -EPNODE *curfunc; +EPNODE *curfunc = NULL; #define dname(ep) ((ep)->v.kid->type == SYM ? \ (ep)->v.kid->v.name : \ (ep)->v.kid->v.kid->v.name) @@ -299,6 +299,8 @@ toolong: incontext(qn) /* is qualified name in current context? */ register char *qn; { + if (!context[0]) /* global context accepts all */ + return(1); while (*qn && *qn != CNTXMARK) /* find context mark */ qn++; return(!strcmp(qn, context)); @@ -327,7 +329,7 @@ int lvl; /* if context is global, clear all */ for (i = 0; i < NHASH; i++) for (vp = hashtbl[i]; vp != NULL; vp = vp->next) - if (!context[0] || incontext(vp->name)) + if (incontext(vp->name)) if (lvl >= 2) dremove(vp->name); else @@ -618,8 +620,7 @@ getdefn() /* A -> SYM = E1 */ syntax("')' expected"); scan(); curfunc = ep1; - } else - curfunc = NULL; + } #endif if (nextc != '=' && nextc != ':') @@ -644,6 +645,10 @@ getdefn() /* A -> SYM = E1 */ ep1->type = NUM; addekid(ep2, ep1); } + +#ifdef FUNCTION + curfunc = NULL; +#endif return(ep2); }