| 323 |
|
} |
| 324 |
|
|
| 325 |
|
|
| 326 |
+ |
getscanpos(fnp, lnp, spp, fpp) /* return current scan position */ |
| 327 |
+ |
char **fnp; |
| 328 |
+ |
int *lnp; |
| 329 |
+ |
char **spp; |
| 330 |
+ |
FILE **fpp; |
| 331 |
+ |
{ |
| 332 |
+ |
if (fnp != NULL) *fnp = infile; |
| 333 |
+ |
if (lnp != NULL) *lnp = lineno; |
| 334 |
+ |
if (spp != NULL) *spp = linbuf+linepos; |
| 335 |
+ |
if (fpp != NULL) *fpp = infp; |
| 336 |
+ |
} |
| 337 |
+ |
|
| 338 |
+ |
|
| 339 |
|
int |
| 340 |
|
scan() /* scan next character, return literal next */ |
| 341 |
|
{ |
| 604 |
|
/* ARG */ |
| 605 |
|
{ |
| 606 |
|
int i; |
| 607 |
+ |
char *nam; |
| 608 |
|
register EPNODE *ep1, *ep2; |
| 609 |
|
|
| 610 |
|
if (nextc == '(') { |
| 628 |
|
|
| 629 |
|
#if defined(VARIABLE) || defined(FUNCTION) |
| 630 |
|
if (isalpha(nextc)) { |
| 631 |
< |
ep1 = newnode(); |
| 618 |
< |
ep1->type = VAR; |
| 619 |
< |
ep1->v.ln = varinsert(getname()); |
| 620 |
< |
|
| 631 |
> |
nam = getname(); |
| 632 |
|
#if defined(VARIABLE) && defined(FUNCTION) |
| 633 |
+ |
ep1 = NULL; |
| 634 |
|
if (curfunc != NULL) |
| 635 |
|
for (i = 1, ep2 = curfunc->v.kid->sibling; |
| 636 |
|
ep2 != NULL; i++, ep2 = ep2->sibling) |
| 637 |
< |
if (!strcmp(ep2->v.name, ep1->v.ln->name)) { |
| 626 |
< |
epfree(ep1); |
| 637 |
> |
if (!strcmp(ep2->v.name, nam)) { |
| 638 |
|
ep1 = newnode(); |
| 639 |
|
ep1->type = ARG; |
| 640 |
|
ep1->v.chan = i; |
| 641 |
|
break; |
| 642 |
|
} |
| 643 |
+ |
if (ep1 == NULL) |
| 644 |
|
#endif |
| 645 |
+ |
{ |
| 646 |
+ |
ep1 = newnode(); |
| 647 |
+ |
ep1->type = VAR; |
| 648 |
+ |
ep1->v.ln = varinsert(nam); |
| 649 |
+ |
} |
| 650 |
|
#ifdef FUNCTION |
| 651 |
|
if (nextc == '(') { |
| 652 |
|
ep2 = newnode(); |