version 1.11, 2017/09/06 06:25:26 |
version 1.12, 2018/03/27 06:29:19 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/subst.c,v 1.10 2015/09/24 04:43:13 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/subst.c,v 1.11 2017/09/06 06:25:26 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
struct oNODE arg0; |
struct oNODE arg0; |
MP m,mp,mp0; |
MP m,mp,mp0; |
DP d; |
DP d; |
|
VL lastvl,vl,tvl,prev,cur; |
|
|
if ( !arg ) { |
if ( !arg ) { |
*rp = 0; return; |
*rp = 0; return; |
|
|
*rp = 0; |
*rp = 0; |
return; |
return; |
} |
} |
|
lastvl = LASTCO; |
switch ( OID(a) ) { |
switch ( OID(a) ) { |
case O_N: case O_P: case O_R: |
case O_N: case O_P: case O_R: |
reductr(CO,(Obj)ARG0(arg),&a); |
reductr(CO,(Obj)ARG0(arg),&a); |
|
|
break; |
break; |
default: |
default: |
error("subst : invalid argument"); |
error("subst : invalid argument"); |
|
} |
|
if ( lastvl != LASTCO ) { |
|
get_vars_recursive(*rp,&vl); |
|
prev = lastvl; cur = NEXT(prev); |
|
while ( cur ) { |
|
v = cur->v; |
|
for ( tvl = vl; tvl && tvl->v != v; tvl = NEXT(tvl) ); |
|
if ( !tvl ) NEXT(prev) = NEXT(cur); |
|
else prev = cur; |
|
cur = NEXT(cur); |
|
} |
|
update_LASTCO(); |
} |
} |
} |
} |
|
|