| 47 |
|
unsigned int esupport = /* what to support */ |
| 48 |
|
E_VARIABLE | E_FUNCTION ; |
| 49 |
|
|
| 50 |
+ |
int eofc = 0; /* optional end-of-file character */ |
| 51 |
|
int nextc; /* lookahead character */ |
| 52 |
|
|
| 53 |
|
double (*eoper[])(EPNODE *) = { /* expression operations */ |
| 145 |
|
case ':': |
| 146 |
|
return(epcmp(ep1->v.kid->sibling, ep2->v.kid->sibling)); |
| 147 |
|
|
| 148 |
< |
case TICK: |
| 148 |
> |
case CLKT: |
| 149 |
|
case SYM: /* should never get this one */ |
| 150 |
|
return(0); |
| 151 |
|
|
| 185 |
|
case NUM: |
| 186 |
|
case CHAN: |
| 187 |
|
case ARG: |
| 188 |
< |
case TICK: |
| 188 |
> |
case CLKT: |
| 189 |
|
break; |
| 190 |
|
|
| 191 |
|
default: |
| 294 |
|
lasterrno = errno; |
| 295 |
|
errno = 0; |
| 296 |
|
d = pow(evalue(ep1), evalue(ep1->sibling)); |
| 297 |
< |
#ifdef IEEE |
| 298 |
< |
if (!finite(d)) |
| 299 |
< |
errno = EDOM; |
| 297 |
> |
#ifdef isnan |
| 298 |
> |
if (errno == 0) |
| 299 |
> |
if (isnan(d)) |
| 300 |
> |
errno = EDOM; |
| 301 |
> |
else if (isinf(d)) |
| 302 |
> |
errno = ERANGE; |
| 303 |
|
#endif |
| 304 |
|
if (errno == EDOM || errno == ERANGE) { |
| 305 |
|
wputs("Illegal power\n"); |
| 417 |
|
nextc = linbuf[linepos++]; |
| 418 |
|
if (!lnext) |
| 419 |
|
lnext = nextc; |
| 420 |
+ |
if (nextc == eofc) { |
| 421 |
+ |
nextc = EOF; |
| 422 |
+ |
break; |
| 423 |
+ |
} |
| 424 |
|
if (nextc == '{') { |
| 425 |
|
scan(); |
| 426 |
|
while (nextc != '}') |