27 |
|
|
28 |
|
#include "copyright.h" |
29 |
|
|
30 |
– |
#include <stdio.h> |
31 |
– |
#include <string.h> |
30 |
|
#include <ctype.h> |
31 |
|
|
32 |
|
#include "rterror.h" |
140 |
|
return; |
141 |
|
} |
142 |
|
} |
143 |
+ |
if (ep1 != NULL && esupport&E_REDEFW) { |
144 |
+ |
wputs(qname); |
145 |
+ |
if (ep1->type == ':') |
146 |
+ |
wputs(": reset constant expression\n"); |
147 |
+ |
else |
148 |
+ |
wputs(": reset expression\n"); |
149 |
+ |
} |
150 |
|
/* hand build definition */ |
151 |
|
ep1 = newnode(); |
152 |
|
ep1->type = assign; |
196 |
|
|
197 |
|
|
198 |
|
int |
199 |
< |
vardefined( /* return non-zero if variable defined */ |
199 |
> |
vardefined( /* return '=' or ':' if variable/constant defined */ |
200 |
|
char *name |
201 |
|
) |
202 |
|
{ |
203 |
|
EPNODE *dp; |
204 |
|
|
205 |
< |
return((dp = dlookup(name)) != NULL && dp->v.kid->type == SYM); |
205 |
> |
if ((dp = dlookup(name)) == NULL || dp->v.kid->type != SYM) |
206 |
> |
return(0); |
207 |
> |
return(dp->type); |
208 |
|
} |
209 |
|
|
210 |
|
|
639 |
|
ep2 = newnode(); |
640 |
|
ep2->type = SYM; |
641 |
|
ep2->v.name = savestr(getname()); |
642 |
+ |
if (strchr(ep2->v.name, CNTXMARK) != NULL) |
643 |
+ |
syntax("illegal parameter name"); |
644 |
|
addekid(ep1, ep2); |
645 |
|
} while (nextc == ','); |
646 |
|
if (nextc != ')') |
706 |
|
|
707 |
|
|
708 |
|
static double /* evaluate a variable */ |
709 |
< |
dvalue(char *name, EPNODE *d) |
709 |
> |
dvalue(char *name, EPNODE *d) |
710 |
|
{ |
711 |
|
EPNODE *ep1, *ep2; |
712 |
|
|
718 |
|
ep1 = d->v.kid->sibling; /* get expression */ |
719 |
|
if (ep1->type == NUM) |
720 |
|
return(ep1->v.num); /* return if number */ |
721 |
+ |
if (esupport&E_RCONST && d->type == ':') { |
722 |
+ |
wputs(name); |
723 |
+ |
wputs(": assigned non-constant value\n"); |
724 |
+ |
} |
725 |
|
ep2 = ep1->sibling; /* check time */ |
726 |
|
if (eclock >= MAXCLOCK) |
727 |
|
eclock = 1; /* wrap clock counter */ |