--- parser3/src/main/compile.y 2001/07/25 08:16:21 1.149 +++ parser3/src/main/compile.y 2001/07/25 11:16:57 1.152 @@ -6,7 +6,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ %{ -static char *RCSId="$Id: compile.y,v 1.149 2001/07/25 08:16:21 parser Exp $"; +static char *RCSId="$Id: compile.y,v 1.152 2001/07/25 11:16:57 parser Exp $"; /** @todo parser4: @@ -103,7 +103,7 @@ static int yylex(YYSTYPE *lvalp, void *p %left NEG /* negation: unary - */ %% -all: +all: one_big_piece { Method& method=*NEW Method(POOL, *main_method_name, @@ -328,7 +328,7 @@ construct_curly: '{' maybe_codes '}' { }; any_constructor_code_value: - unknown_value /* optimized $var[] case */ + empty_string_value /* optimized $var[] case */ | STRING /* optimized $var[STRING] case */ | constructor_code_value /* $var[something complex] */ ; @@ -397,7 +397,7 @@ store_curly_param_part: maybe_codes { PCA($$, $1); }; code_param_value: - unknown_value /* optimized [;...] case */ + empty_void_value /* optimized [;...] case */ | STRING /* optimized [STRING] case */ | constructor_code_value /* [something complex] */ ; @@ -526,7 +526,8 @@ write_string: STRING { change_string_literal_to_write_string_literal($$=$1) }; -unknown_value: /* empty */ { $$=VL(NEW VVoid(POOL)) }; +empty_void_value: /* empty */ { $$=VL(NEW VVoid(POOL)) }; +empty_string_value: /* empty */ { $$=VL(NEW VString(POOL)) }; empty: /* empty */ { $$=N(POOL) }; %% @@ -635,6 +636,13 @@ static int yylex(YYSTYPE *lvalp, void *p // USER'S = NOT OURS case LS_USER: + if(PC.skipping_bof_empty_lines) + if(c=='\n') { + begin=PC.source; + begin_line=PC.line; + continue; // skip it + } + PC.skipping_bof_empty_lines=false; switch(c) { case '$': push_LS(PC, LS_VAR_NAME_SIMPLE);