pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: las.c,v 1.59 1998/04/19 03:16:11 per Exp $"); + RCSID("$Id: las.c,v 1.60 1998/04/20 02:36:13 hubbe Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:328:   node *mknode(short token,node *a,node *b)   {    node *res;    check_tree(a,0);    check_tree(b,0);    res = mkemptynode();    CAR(res) = a;    CDR(res) = b;    res->node_info = 0;    res->tree_info = 0; +  if(a) a->parent = res; +  if(b) b->parent = res; +  +  /* We try to optimize most things, but argument lists are hard... */ +  if(token != F_ARG_LIST && (a || b)) +  res->node_info |= OPT_TRY_OPTIMIZE; +     switch(token)    {    case F_CATCH:    res->node_info |= OPT_SIDE_EFFECT;    break;       case F_APPLY:    if(a && a->token == F_CONSTANT &&    a->u.sval.type == T_FUNCTION &&    a->u.sval.subtype == FUNCTION_BUILTIN)
pike.git/src/las.c:376:    case F_SSCANF:    if(!b || count_args(b) == 0) break;    /* fall through */       case F_ASSIGN:    case F_INC:    case F_DEC:    case F_POST_INC:    case F_POST_DEC:    res->node_info |= OPT_ASSIGNMENT; +  break; +  +  default: +  res->tree_info = res->node_info; +  if(a) res->tree_info |= a->tree_info; +  if(b) res->tree_info |= b->tree_info;    }    res->token = token;    res->type = 0;    -  /* We try to optimize most things, but argument lists are hard... */ -  if(token != F_ARG_LIST && (a || b)) -  res->node_info |= OPT_TRY_OPTIMIZE; +     -  if(a) a->parent = res; -  if(b) b->parent = res; -  +    #ifdef DEBUG    if(d_flag > 3)    verify_shared_strings_tables();   #endif       if(!num_parse_error && compiler_pass==2)    {    check_tree(res,0);    optimize(res);    check_tree(res,0);