=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/eval.c,v retrieving revision 1.29 retrieving revision 1.33 diff -u -p -r1.29 -r1.33 --- OpenXM_contrib2/asir2000/parse/eval.c 2003/05/30 00:47:24 1.29 +++ OpenXM_contrib2/asir2000/parse/eval.c 2004/05/14 09:20:57 1.33 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/eval.c,v 1.28 2003/05/24 10:42:18 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/eval.c,v 1.32 2004/04/30 08:25:38 noro Exp $ */ #include #include "ca.h" @@ -84,6 +84,7 @@ pointer eval(FNODE f) GF2N gf2n; GFPN gfpn; GFSN gfsn; + RANGE range; #if defined(VISUAL) if ( recv_intr ) { @@ -455,8 +456,8 @@ pointer evalf(FUNC f,FNODE a,FNODE opt) LIST args; pointer val; int i,n,level; - NODE tn,sn,opts,opt1; - VS pvs,prev_mpvs; + NODE tn,sn,opts,opt1,dmy; + VS pvs,prev_mpvs; char errbuf[BUFSIZ]; static unsigned int stack_size; static void *stack_base; @@ -474,11 +475,26 @@ pointer evalf(FUNC f,FNODE a,FNODE opt) } switch ( f->id ) { case A_BIN: + if ( opt ) { + opts = BDY((LIST)eval(opt)); + /* opts = ["opt1",arg1],... */ + opt1 = BDY((LIST)BDY(opts)); + if ( !strcmp(BDY((STRING)BDY(opt1)),"option_list") ) { + /* + * the special option specification: + * option_list=[["o1","a1"],...] + */ + asir_assert(BDY(NEXT(opt1)),O_LIST,"evalf"); + opts = BDY((LIST)BDY(NEXT(opt1))); + } + } else + opts = 0; if ( !n ) { cur_binf = f; (*f->f.binf)(&val); } else { args = (LIST)eval(a); + current_option = opts; cur_binf = f; (*f->f.binf)(args?BDY(args):0,&val); }