--- parser3/src/main/compile.y 2001/05/10 12:42:34 1.131 +++ parser3/src/main/compile.y 2001/05/21 16:01:10 1.135 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.131 2001/05/10 12:42:34 paf Exp $ + $Id: compile.y,v 1.135 2001/05/21 16:01:10 parser Exp $ */ /** @@ -28,8 +28,6 @@ #define yyerror(msg) real_yyerror((parse_control *)pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) -#include "pa_config_includes.h" - #include "compile_tools.h" #include "pa_value.h" #include "pa_request.h" @@ -125,7 +123,7 @@ one_big_piece: maybe_codes; method: control_method | code_method; control_method: '@' STRING '\n' - control_strings { + maybe_control_strings { const String& command=*LA2S($2); YYSTYPE strings_code=$4; if(command==END_CONTROL_METHOD_NAME && strings_code->size()==0) @@ -160,7 +158,7 @@ control_method: '@' STRING '\n' PC.request->use_file( PC.request->absolute(*LA2S(strings_code, i))); } else if(command==BASE_NAME) { - if(PC.cclass->base()) { // already changed from default? + if(PC.cclass->base()!=&PC.request->OP) { // already changed from default? strcpy(PC.error, "class already have a base '"); strncat(PC.error, PC.cclass->base()->name().cstr(), 100); strcat(PC.error, "'"); @@ -193,6 +191,7 @@ control_method: '@' STRING '\n' YYERROR; } }; +maybe_control_strings: empty | control_strings; control_strings: control_string | control_strings control_string { $$=$1; P($$, $2) }; control_string: maybe_string '\n'; maybe_string: empty | STRING; @@ -1061,7 +1060,7 @@ break2: // strip last \n end--; } - if(end!=begin) { // last piece still alive? + if(end!=begin && PC.ls!=LS_COMMENT) { // last piece still alive and not comment? // append it PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line/*, start_col*/); }