--- ray/src/common/calexpr.c 1991/08/08 12:11:19 1.13 +++ ray/src/common/calexpr.c 1991/08/14 08:18:14 1.15 @@ -1,4 +1,4 @@ -/* Copyright (c) 1986 Regents of the University of California */ +/* Copyright (c) 1991 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -444,6 +444,8 @@ getname() /* scan an identifier */ for (i = 0; i < MAXWORD && isid(lnext); i++, lnext = scan()) str[i] = lnext; str[i] = '\0'; + while (isid(lnext)) /* skip rest of name */ + lnext = scan(); return(str); } @@ -604,6 +606,7 @@ getE5() /* E5 -> (E1) */ /* ARG */ { int i; + char *nam; register EPNODE *ep1, *ep2; if (nextc == '(') { @@ -626,23 +629,26 @@ getE5() /* E5 -> (E1) */ #endif #if defined(VARIABLE) || defined(FUNCTION) - if (isalpha(nextc)) { - ep1 = newnode(); - ep1->type = VAR; - ep1->v.ln = varinsert(getname()); - + if (isalpha(nextc) || nextc == CNTXMARK) { + nam = getname(); #if defined(VARIABLE) && defined(FUNCTION) + ep1 = NULL; if (curfunc != NULL) for (i = 1, ep2 = curfunc->v.kid->sibling; ep2 != NULL; i++, ep2 = ep2->sibling) - if (!strcmp(ep2->v.name, ep1->v.ln->name)) { - epfree(ep1); + if (!strcmp(ep2->v.name, nam)) { ep1 = newnode(); ep1->type = ARG; ep1->v.chan = i; break; } + if (ep1 == NULL) #endif + { + ep1 = newnode(); + ep1->type = VAR; + ep1->v.ln = varinsert(nam); + } #ifdef FUNCTION if (nextc == '(') { ep2 = newnode();