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.268 2001/09/28 00:01:45 hubbe Exp $"); + RCSID("$Id: las.c,v 1.269 2001/09/29 06:19:27 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:1294:    res->u.id.prog = Pike_compiler->new_program;   #endif /* SHARED_NODES */       res = freeze_node(res);       check_tree(res,0);    return res;   #endif   }    - node *debug_mktrampolinenode(int i) + node *debug_mktrampolinenode(int i, struct compiler_frame *frame)   { -  +  struct compiler_frame *f;    node *res = mkemptynode(); -  +     res->token = F_TRAMPOLINE;    copy_pike_type(res->type, ID_FROM_INT(Pike_compiler->new_program, i)->type);       /* FIXME */    if(IDENTIFIER_IS_CONSTANT(ID_FROM_INT(Pike_compiler->new_program, i)->identifier_flags))    {    res->node_info = OPT_EXTERNAL_DEPEND;    }else{    res->node_info = OPT_NOT_CONST;    }    res->tree_info=res->node_info;      #ifdef __CHECKER__    _CDR(res) = 0;   #endif -  res->u.id.number = i; +  res->u.trampoline.ident=i; +  res->u.trampoline.frame=frame; +  +  for(f=Pike_compiler->compiler_frame;f != frame;f=f->previous) +  f->lexical_scope|=SCOPE_SCOPED; +  f->lexical_scope|=SCOPE_SCOPE_USED; +    #ifdef SHARED_NODES -  res->u.id.prog = Pike_compiler->new_program; +  res->u.trampoline.prog = Pike_compiler->new_program;   #endif /* SHARED_NODES */       res = freeze_node(res);       check_tree(res,0);    return res;   }      node *debug_mkexternalnode(struct program *parent_prog, int i)   {
pike.git/src/las.c:1857:    check_tree(b,0);       if(a == b) return 1;    if(!a || !b) return 0;    if(a->token != b->token) return 0;       fatal_check_c_stack(16384);       switch(a->token)    { +  case F_TRAMPOLINE: /* FIXME, the context has to be the same! */ + #ifdef SHARED_NODES +  if(a->u.trampoline.prog != b->u.trampoline.prog) +  return 0; + #endif +  return a->u.trampoline.ident == b->u.trampoline.ident && +  a->u.trampoline.frame == b->u.trampoline.frame; +     case F_EXTERNAL:    case F_LOCAL:    return a->u.integer.a == b->u.integer.a &&    a->u.integer.b == b->u.integer.b;       case F_IDENTIFIER: -  case F_TRAMPOLINE: /* FIXME, the context has to be the same! */ +     return a->u.id.number == b->u.id.number;       case F_CAST:    case F_SOFT_CAST:    return a->type == b->type && node_is_eq(CAR(a), CAR(b));       case F_CONSTANT:    return is_equal(&(a->u.sval), &(b->u.sval));       default:
pike.git/src/las.c:2363:    name = id->name->str;    }    }    fprintf(stderr, "%s", name);    }    break;       case F_TRAMPOLINE:    if (Pike_compiler->new_program) {    fprintf(stderr, "trampoline<%s>", -  ID_FROM_INT(Pike_compiler->new_program, foo->u.id.number)->name->str); +  ID_FROM_INT(Pike_compiler->new_program, foo->u.trampoline.ident)->name->str);    } else {    fprintf(stderr, "trampoline<unknown identifier>");    }    break;       case F_ASSIGN:    low_print_tree(_CDR(foo),1);    fprintf(stderr, "=");    low_print_tree(_CAR(foo),0);    break;
pike.git/src/las.c:3348:    }    break;       case F_AUTO_MAP_MARKER:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Indexing a void expression.");    /* The optimizer converts this to an expression returning 0. */    copy_pike_type(n->type, zero_type_string);    } else {    type_a=CAR(n)->type; -  if(!check_indexing(type_a, int_type_string, n)) +  if(!match_types(type_a, array_type_string))    if(!Pike_compiler->catch_level)    my_yyerror("[*] on non-array.");    n->type=index_type(type_a, int_type_string, n);    }    break;       case F_AUTO_MAP:    case F_APPLY:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Calling a void expression.");