78 |
|
esubtr, |
79 |
|
0, |
80 |
|
edivi, |
81 |
< |
0,0,0,0,0,0,0,0,0,0,0,0,0, |
81 |
> |
0,0,0,0,0,0,0,0,0,0, |
82 |
|
ebotch, |
83 |
+ |
0,0, |
84 |
+ |
ebotch, |
85 |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
86 |
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
87 |
|
epow, |
383 |
|
{ |
384 |
|
register int i; |
385 |
|
|
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("^ "); |
386 |
|
if (infile != NULL || lineno != 0) { |
391 |
– |
eputs("\n"); |
387 |
|
if (infile != NULL) eputs(infile); |
388 |
|
if (lineno != 0) { |
389 |
|
eputs(infile != NULL ? ", line " : "line "); |
390 |
|
eputs(ltoa((long)lineno)); |
391 |
|
} |
392 |
< |
eputs(": "); |
392 |
> |
eputs(": syntax error:\n"); |
393 |
|
} |
394 |
+ |
eputs(linbuf); |
395 |
+ |
if (linbuf[strlen(linbuf)-1] != '\n') |
396 |
+ |
eputs("\n"); |
397 |
+ |
for (i = 0; i < linepos-1; i++) |
398 |
+ |
eputs(linbuf[i] == '\t' ? "\t" : " "); |
399 |
+ |
eputs("^ "); |
400 |
|
eputs(err); |
401 |
|
eputs("\n"); |
402 |
|
quit(1); |
530 |
|
|
531 |
|
|
532 |
|
EPNODE * |
533 |
< |
getE3() /* E3 -> E3 ^ E4 */ |
533 |
> |
getE3() /* E3 -> E4 ^ E3 */ |
534 |
|
/* E4 */ |
535 |
|
{ |
536 |
|
register EPNODE *ep1, *ep2; |
537 |
|
|
538 |
|
ep1 = getE4(); |
539 |
< |
while (nextc == '^') { |
539 |
> |
if (nextc == '^') { |
540 |
|
ep2 = newnode(); |
541 |
|
ep2->type = nextc; |
542 |
|
scan(); |
543 |
|
addekid(ep2, ep1); |
544 |
< |
addekid(ep2, getE4()); |
544 |
> |
addekid(ep2, getE3()); |
545 |
|
#ifdef RCONST |
546 |
|
if (ep1->type == NUM && ep1->sibling->type == NUM) |
547 |
|
ep2 = rconst(ep2); |
548 |
|
#endif |
549 |
< |
ep1 = ep2; |
549 |
> |
return(ep2); |
550 |
|
} |
551 |
|
return(ep1); |
552 |
|
} |
643 |
|
syntax("'(' expected"); |
644 |
|
#endif |
645 |
|
#endif |
646 |
+ |
#ifdef RCONST |
647 |
+ |
if (isconstvar(ep1)) |
648 |
+ |
ep1 = rconst(ep1); |
649 |
+ |
#endif |
650 |
|
return(ep1); |
651 |
|
} |
652 |
|
#endif |
677 |
|
epfree(epar); |
678 |
|
|
679 |
|
return(ep); |
680 |
+ |
} |
681 |
+ |
|
682 |
+ |
|
683 |
+ |
isconstvar(ep) /* is ep linked to a constant? */ |
684 |
+ |
register EPNODE *ep; |
685 |
+ |
{ |
686 |
+ |
#ifdef VARIABLE |
687 |
+ |
register EPNODE *ep1; |
688 |
+ |
#ifdef FUNCTION |
689 |
+ |
LIBR *lp; |
690 |
+ |
|
691 |
+ |
if (ep->type == FUNC) { |
692 |
+ |
if (ep->v.kid->type != VAR) |
693 |
+ |
return(0); |
694 |
+ |
ep1 = ep->v.kid->v.ln->def; |
695 |
+ |
if (ep1 != NULL && ep1->type != ':') |
696 |
+ |
return(0); |
697 |
+ |
if ((ep1 == NULL || ep1->v.kid->type != FUNC) |
698 |
+ |
&& ((lp = liblookup(ep->v.kid->v.ln->name)) == NULL |
699 |
+ |
|| lp->atyp != ':')) |
700 |
+ |
return(0); |
701 |
+ |
for (ep1 = ep->v.kid->sibling; ep1 != NULL; ep1 = ep1->sibling) |
702 |
+ |
if (ep1->type != NUM) |
703 |
+ |
return(0); |
704 |
+ |
return(1); |
705 |
+ |
} |
706 |
+ |
#endif |
707 |
+ |
if (ep->type != VAR) |
708 |
+ |
return(0); |
709 |
+ |
ep1 = ep->v.ln->def; |
710 |
+ |
if (ep1 == NULL || ep1->type != ':') |
711 |
+ |
return(0); |
712 |
+ |
#ifdef FUNCTION |
713 |
+ |
if (ep1->v.kid->type != SYM) |
714 |
+ |
return(0); |
715 |
+ |
#endif |
716 |
+ |
return(1); |
717 |
+ |
#else |
718 |
+ |
return(ep->type == FUNC); |
719 |
+ |
#endif |
720 |
|
} |
721 |
|
#endif |