ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/calexpr.c
(Generate patch)

Comparing ray/src/common/calexpr.c (file contents):
Revision 1.6 by greg, Thu Jul 19 12:56:50 1990 UTC vs.
Revision 1.8 by greg, Wed Apr 17 10:54:58 1991 UTC

# Line 381 | Line 381 | char  *err;
381   {
382      register int  i;
383  
384    eputs(linbuf);
385    if (linbuf[strlen(linbuf)-1] != '\n')
386        eputs("\n");
387    for (i = 0; i < linepos-1; i++)
388        eputs(linbuf[i] == '\t' ? "\t" : " ");
389    eputs("^ ");
384      if (infile != NULL || lineno != 0) {
391        eputs("\n");
385          if (infile != NULL) eputs(infile);
386          if (lineno != 0) {
387              eputs(infile != NULL ? ", line " : "line ");
388              eputs(ltoa((long)lineno));
389          }
390 <        eputs(": ");
390 >        eputs(": syntax error:\n");
391      }
392 +    eputs(linbuf);
393 +    if (linbuf[strlen(linbuf)-1] != '\n')
394 +        eputs("\n");
395 +    for (i = 0; i < linepos-1; i++)
396 +        eputs(linbuf[i] == '\t' ? "\t" : " ");
397 +    eputs("^ ");
398      eputs(err);
399      eputs("\n");
400      quit(1);
# Line 529 | Line 528 | getE2()                                /* E2 -> E2 MULOP E3 */
528  
529  
530   EPNODE *
531 < getE3()                         /* E3 -> E3 ^ E4 */
531 > getE3()                         /* E3 -> E4 ^ E3 */
532                                  /*       E4 */
533   {
534      register EPNODE  *ep1, *ep2;
535  
536      ep1 = getE4();
537 <    while (nextc == '^') {
537 >    if (nextc == '^') {
538          ep2 = newnode();
539          ep2->type = nextc;
540          scan();
541          addekid(ep2, ep1);
542 <        addekid(ep2, getE4());
542 >        addekid(ep2, getE3());
543   #ifdef  RCONST
544          if (ep1->type == NUM && ep1->sibling->type == NUM)
545                  ep2 = rconst(ep2);
546   #endif
547 <        ep1 = ep2;
547 >        return(ep2);
548      }
549      return(ep1);
550   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines