--- parser3/src/main/compile.y 2001/05/21 17:12:58 1.136 +++ parser3/src/main/compile.y 2001/06/27 12:44:32 1.140 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.136 2001/05/21 17:12:58 parser Exp $ + $Id: compile.y,v 1.140 2001/06/27 12:44:32 parser Exp $ */ /** @@ -135,7 +135,7 @@ control_method: '@' STRING '\n' YYERROR; } if(command==CLASS_NAME) { - if(PC.cclass!=&PC.request->OP) { // already changed from default? + if(PC.cclass) { // already changed from default? strcpy(PC.error, "class already have a name '"); strncat(PC.error, PC.cclass->name().cstr(), 100); strcat(PC.error, "'"); @@ -344,9 +344,9 @@ call_value: '^' call_name store_params E O($$, OP_GET_METHOD_FRAME); /* stack: context,method_frame */ YYSTYPE params_code=$3; - if(params_code->size()==3) // probably [] case. [OP_VALUE + Nothing + STORE_PARAM] + if(params_code->size()==3) // probably [] case. [OP_VALUE + Void + STORE_PARAM] if(Value *value=LA2V(params_code)) // it is OP_VALUE + value? - if(!value->is_defined()) // value is VNothing? + if(!value->is_defined()) // value is VVoid? params_code=0; // ^zzz[] case. don't append lone empty param. if(params_code) P($$, params_code); // filling method_frame.store_params @@ -527,7 +527,7 @@ write_string: STRING { change_string_literal_to_write_string_literal($$=$1) }; -unknown_value: /* empty */ { $$=VL(NEW VNothing(POOL)) }; +unknown_value: /* empty */ { $$=VL(NEW VVoid(POOL)) }; empty: /* empty */ { $$=N(POOL) }; %% @@ -873,12 +873,14 @@ static int yylex(YYSTYPE *lvalp, void *p case ';': case ']': case '}': case ')': case '"': case '\'': - case '<': case '>': // these stand for HTML brackets and expression binary ops + case '<': case '>': // these stand for HTML brackets AND expression binary ops case '+': case '*': case '/': case '%': case '&': case '|': case '=': case '!': // common delimiters case ',': + // before call + case '^': pop_LS(PC); PC.source--; if(--PC.col<0) { PC.line--; PC.col=-1; } result=EON; @@ -1059,6 +1061,8 @@ break2: if((c=='@' || c==0) && end[-1]=='\n') { // we are before LS_DEF_NAME or EOF? // strip last \n end--; + if(end!=begin && end[-1]=='\n') // allow one empty line before LS_DEF_NAME + end--; } if(end!=begin && PC.ls!=LS_COMMENT) { // last piece still alive and not comment? // append it