Branch: Tag:

1996-02-19

1996-02-19 04:37:36 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Implemented operator functions

Rev: lib/simulate.lpc:1.8
Rev: src/add_efun.c:1.2
Rev: src/add_efun.h:1.2
Rev: src/builtin_efuns.c:1.9
Rev: src/docode.c:1.3
Rev: src/docode.h:1.2
Rev: src/interpret.c:1.7
Rev: src/language.y:1.9
Rev: src/las.c:1.4
Rev: src/las.h:1.4
Rev: src/lex.c:1.6
Rev: src/modules/files/efuns.c:1.4
Rev: src/operators.c:1.2
Rev: src/operators.h:1.2

67:      INT32 count_args(node *n)   { +  int a,b;    if(!n) return 0;    switch(n->token)    {    case F_VAL_LVAL:    case F_ARG_LIST: -  return count_args(CAR(n)) + count_args(CDR(n)); +  a=count_args(CAR(n)); +  if(a==-1) return -1; +  b=count_args(CDR(n)); +  if(b==-1) return -1; +  return a+b;       case F_CAST:    if(n->type == void_type_string)
98:    int tmp1,tmp2;    tmp1=count_args(CDAR(n));    tmp2=count_args(CDAR(n)); +  if(tmp1==-1 || tmp2==-2) return -1;    if(tmp1 < tmp2) return tmp1;    return tmp2;    }
267:    return mkapplynode(mksvaluenode(&fun->function), args);   }    + node *mkopernode(char *oper_id, node *arg1, node *arg2) + { +  if(arg1 && arg2) +  arg1=mknode(F_ARG_LIST,arg1,arg2); +  +  return mkefuncallnode(oper_id, arg1); + } +    node *mklocalnode(int var)   {    node *res = mkemptynode();