--- parser3/src/main/compile.y 2001/05/07 07:46:43 1.130 +++ parser3/src/main/compile.y 2001/05/15 10:01:25 1.133 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.130 2001/05/07 07:46:43 paf Exp $ + $Id: compile.y,v 1.133 2001/05/15 10:01:25 parser Exp $ */ /** @@ -87,19 +87,18 @@ static int yylex(YYSTYPE *lvalp, void *p %token IS "is" /* logical */ -%left "is" -%left "lt" "gt" "le" "ge" -%left "eq" "ne" -%left '<' '>' "<=" ">=" "##" -%left "==" "!=" +%left "##" %left "||" %left "&&" -%left "def" "in" "-f" "-d" +%left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" +%left "==" "!=" "eq" "ne" +%left "is" "def" "in" "-f" "-d" %left '!' /* bitwise */ %left '#' -%left '&' '|' +%left '|' +%left '&' %left '~' /* numerical */ @@ -126,7 +125,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) @@ -194,6 +193,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; @@ -460,7 +460,7 @@ class_prefix: STRING ':' { /* with */ -with: '$' name_without_curly_rdive '{' codes '}' { +with: '$' name_without_curly_rdive '{' maybe_codes '}' { $$=$2; O($$, OP_CREATE_RWPOOL); P($$, $4); @@ -1062,7 +1062,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*/); }