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.46 1998/01/27 20:51:56 hubbe Exp $"); + RCSID("$Id: las.c,v 1.47 1998/01/29 00:30:34 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:517:   node *mkexternalnode(int level,    int i,    struct identifier *id)   {    node *res = mkemptynode();    res->token = F_EXTERNAL;       copy_shared_string(res->type, id->type);       /* FIXME */ +  if(IDENTIFIER_IS_CONSTANT(ID_FROM_INT(parent_compilation(level), 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.integer.a = level;    res->u.integer.b = i;    return res;   }   
pike.git/src/las.c:765:    case T_ARRAY:    return make_node_from_array(s->u.array);       case T_MULTISET:    return make_node_from_multiset(s->u.multiset);       case T_MAPPING:    return make_node_from_mapping(s->u.mapping);       case T_OBJECT: -  if(s->u.object == &fake_object) +  if(s->u.object == fake_object)    {    return mkefuncallnode("this_object", 0); - /* }else{ -  yyerror("Non-constant object pointer! (should not happen!)"); -  */ +     } -  +  if(s->u.object->next == s->u.object) +  { +  int x=0; +  struct object *o; +  node *n=mkefuncallnode("this_object", 0); +  for(o=fake_object;o!=s->u.object;o=o->parent) +  { +  n=mkefuncallnode("function_object", +  mkefuncallnode("object_program",n)); +  } +  return n; +  }    break;       case T_FUNCTION:    {    if(s->subtype != FUNCTION_BUILTIN)    { -  if(s->u.object == &fake_object) +  if(s->u.object == fake_object)    return mkidentifiernode(s->subtype);    -  +  if(s->u.object->next == s->u.object) +  { +  int x=0; +  struct object *o; +  for(o=fake_object->parent;o!=s->u.object;o=o->parent) x++; +  return mkexternalnode(x, s->subtype, +  ID_FROM_INT(o->prog, s->subtype)); +  +  } +    /* yyerror("Non-constant function pointer! (should not happen!)"); */    }    }    }       return mkconstantsvaluenode(s);   }         /* these routines operates on parsetrees and are mostly used by the
pike.git/src/las.c:2046:    ret=-1;    if(!num_parse_error)    {    struct callback *tmp_callback;    struct timer_oflo foo;       /* This is how long we try to optimize before giving up... */    foo.counter=10000;    foo.yes=0;    -  setup_fake_object(); -  +     tmp_callback=add_to_callback(&evaluator_callbacks,    check_evaluation_time,    (void *)&foo,0);    -  if(apply_low_safe_and_stupid(&fake_object, jump)) +  if(apply_low_safe_and_stupid(fake_object, jump))    {    /* Generate error message */    if(throw_value.type == T_ARRAY && throw_value.u.array->size)    {    union anything *a;    a=low_array_get_item_ptr(throw_value.u.array, 0, T_STRING);    if(a)    {    yyerror(a->string->str);    }else{