Branch: Tag:

2009-09-12

2009-09-12 13:31:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Cleaned up facet handling somewhat.
Added a few FIXMEs.

Rev: src/language.yacc:1.452
Rev: src/program.c:1.771
Rev: src/program.h:1.267

2:   || 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: language.yacc,v 1.451 2009/06/22 18:51:14 grubba Exp $ + || $Id: language.yacc,v 1.452 2009/09/12 13:31:38 grubba Exp $   */      %pure_parser
468:   #ifdef WITH_FACETS    struct object *o;    if (Pike_compiler->compiler_pass == 1) { -  if (Pike_compiler->new_program->facet_class == PROGRAM_IS_FACET_CLASS) { +  if (Pike_compiler->new_program->flags & PROGRAM_IS_FACET) {    yyerror("A class can only belong to one facet.");    }    else {
478:    o = Pike_sp[-1].u.object;    ref_push_string($2->u.sval.u.string);    push_int(Pike_compiler->new_program->id); -  push_int(Pike_compiler->new_program->facet_class); +  push_int(!!(Pike_compiler->new_program->flags & PROGRAM_IS_PRODUCT));    safe_apply(o, "add_facet_class", 3);    if (Pike_sp[-1].type == T_INT &&    Pike_sp[-1].u.integer >= 0) { -  Pike_compiler->new_program->facet_class = PROGRAM_IS_FACET_CLASS; +  Pike_compiler->new_program->flags &= ~PROGRAM_IS_PRODUCT; +  Pike_compiler->new_program->flags |= PROGRAM_IS_FACET;    Pike_compiler->new_program->facet_index = Pike_sp[-1].u.integer;    add_ref(Pike_compiler->new_program->facet_group = o);    }
530:    /* If this is a product class, check that all product classes in its    * facet-group inherit from all facets */    if($3 && Pike_compiler->compiler_pass == 2) { -  if (Pike_compiler->new_program->facet_class==PROGRAM_IS_PRODUCT_CLASS){ +  if (Pike_compiler->new_program->flags & PROGRAM_IS_PRODUCT) {    if (!Pike_compiler->new_program->facet_group)    yyerror("Product class without facet group.");    else {