--- ray/src/common/calexpr.c 1991/08/08 13:40:09 1.14 +++ ray/src/common/calexpr.c 1991/08/14 16:26:31 1.16 @@ -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); } @@ -584,6 +586,10 @@ getE4() /* E4 -> ADDOP E5 */ ep2->v.num = -ep2->v.num; return(ep2); } + if (ep2->type == UMINUS) { /* don't generate -(-E5) */ + efree((char *)ep2); + return(ep2->v.kid); + } ep1 = newnode(); ep1->type = UMINUS; addekid(ep1, ep2); @@ -627,7 +633,7 @@ getE5() /* E5 -> (E1) */ #endif #if defined(VARIABLE) || defined(FUNCTION) - if (isalpha(nextc)) { + if (isalpha(nextc) || nextc == CNTXMARK) { nam = getname(); #if defined(VARIABLE) && defined(FUNCTION) ep1 = NULL;