--- parser3/src/main/compile.y 2001/03/23 13:08:10 1.108 +++ parser3/src/main/compile.y 2001/03/24 09:57:51 1.109 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.108 2001/03/23 13:08:10 paf Exp $ + $Id: compile.y,v 1.109 2001/03/24 09:57:51 paf Exp $ */ /** @@ -155,11 +155,9 @@ control_method: '@' STRING '\n' } } else { if(command==USE_CONTROL_METHOD_NAME) { - for(int i=0; isize(); i+=2) { - String file(*SLA2S(strings_code, i)); - file.APPEND_CONST(".p"); - PC->request->use_file(file.cstr()); - } + for(int i=0; isize(); i+=2) + PC->request->use_file( + PC->request->absolute(SLA2S(strings_code, i)->cstr())); } else if(command==BASE_NAME) { if(PC->cclass->base()!=&PC->request->ROOT) { // already changed from default? strcpy(PC->error, "class already have a base '"); @@ -177,6 +175,11 @@ control_method: '@' STRING '\n' strcat(PC->error, ": undefined class in @"BASE_NAME); YYERROR; } + // @CLASS == @BASE sanity check + if(PC->cclass==base) { + strcpy(PC->error, "@"CLASS_NAME" equals @"BASE_NAME); + YYERROR; + } PC->cclass->set_base(*base); } else { strcpy(PC->error, "@"BASE_NAME" must contain sole name");