pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.576 2004/11/05 17:56:34 grubba Exp $ + || $Id: program.c,v 1.577 2004/11/06 08:41:30 nilsson Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:3603: Inside #if 0
      return locate_parent_state(&state,    &i,    &parent_identifier,    depth);   }   #endif      void check_for_facet_inherit(struct program *p)   { -  int fid; +     /* If the inherit statement comes before the facet keyword in the    * class declaration the class will be temporarily marked as a    * product-class, but this will be taken care of when the facet    * keyword is found. */    if (p && Pike_compiler->new_program->facet_group &&    p->facet_group != Pike_compiler->new_program->facet_group) -  yyerror("A class can not belong to two facet-groups\n"); +  yyerror("A class can not belong to two facet-groups.");    if (p && p->facet_class == PROGRAM_IS_FACET_CLASS) {    if (Pike_compiler->new_program->facet_class == PROGRAM_IS_FACET_CLASS) {    if(Pike_compiler->new_program->facet_index != p->facet_index)    yyerror("Facet class can't inherit from class in different facet.");    }    /* Otherwise this is a product class */    else { -  int line = 0; +  if( !Pike_compiler->new_program->facet_group ) {    Pike_compiler->new_program->facet_class = PROGRAM_IS_PRODUCT_CLASS; -  +  add_ref(p->facet_group);    Pike_compiler->new_program->facet_group = p->facet_group; -  +  }    push_int(Pike_compiler->new_program->id);    push_int(p->facet_index);    push_int(p->id);    safe_apply_low3(p->facet_group,    find_identifier("add_product_class",    p->facet_group->prog),    3,    "Unable to add product class");    }    }
pike.git/src/program.c:3642:    else if (p && p->facet_class == PROGRAM_IS_PRODUCT_CLASS) {    if (Pike_compiler->new_program->facet_class == PROGRAM_IS_FACET_CLASS) {    yyerror("Facet class can't inherit from product class.");    }    else if(Pike_compiler->new_program->facet_class==PROGRAM_IS_PRODUCT_CLASS){    yyerror("Product class can't inherit from other prodcut class.");    }    /* A class that inherits from a product class is also a product class */    else if(Pike_compiler->new_program->facet_class!=PROGRAM_IS_FACET_CLASS) {    Pike_compiler->new_program->facet_class = PROGRAM_IS_PRODUCT_CLASS; +  add_ref(p->facet_group);    Pike_compiler->new_program->facet_group = p->facet_group;    }    }   }         /*    * make this program inherit another program    */   void low_inherit(struct program *p,
pike.git/src/program.c:5986:    pop_stack();    free_svalue(&thrown);   }      extern void yyparse(void);      #ifdef PIKE_DEBUG   #define do_yyparse() do { \    struct svalue *save_sp=Pike_sp; \    yyparse(); /* Parse da program */ \ -  if(save_sp != Pike_sp) \ -  Pike_fatal("yyparse() left %"PRINTPTRDIFFT"d droppings on the stack!\n", \ +  if(save_sp != Pike_sp) { \ +  Pike_fatal("yyparse() left %"PRINTPTRDIFFT"d droppings on the stack!\n", \    Pike_sp - save_sp); \ -  +  } \   }while(0)   #else   #define do_yyparse() yyparse()   #endif      struct Supporter *current_supporter=0;         #ifdef PIKE_DEBUG