--- parser3/src/main/compile.y 2002/02/07 11:16:28 1.179 +++ parser3/src/main/compile.y 2002/02/18 12:05:02 1.181 @@ -5,7 +5,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.179 2002/02/07 11:16:28 paf Exp $ + $Id: compile.y,v 1.181 2002/02/18 12:05:02 paf Exp $ */ /** @@ -264,7 +264,7 @@ name_without_curly_rdive_read: name_with // ^if ELEMENT -> ^if ELEMENT_OR_OPERATOR // OP_VALUE+string+OP_GET_ELEMENT. -> OP_VALUE+string+OP_GET_ELEMENT_OR_OPERATOR. - if(diving_code->size()==3) + if(PC.in_call_value && diving_code->size()==3) diving_code->put_int(2, OP_GET_ELEMENT_OR_OPERATOR); P($$, diving_code); } @@ -351,10 +351,10 @@ call: call_value { O($$, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ }; call_value: '^' { - PC.object_constructor_allowed=true; + PC.in_call_value=true; } call_name { - PC.object_constructor_allowed=false; + PC.in_call_value=false; } store_params EON { /* ^field.$method{vasya} */ $$=$3; /* with_xxx,diving code; stack: context,method_junction */ @@ -481,7 +481,7 @@ class_static_prefix: STRING ':' { }; class_constructor_prefix: class_static_prefix ':' { $$=$1; - if(!PC.object_constructor_allowed) { + if(!PC.in_call_value) { strcpy(PC.error, ":: not allowed here"); YYERROR; } @@ -943,9 +943,12 @@ default: if( PC.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || PC.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { - // name in expr ends also before binary operators + // name in expr ends also before switch(c) { + // expression minus case '-': + // expression integer division + case '\\': pop_LS(PC); PC.source--; if(--PC.col<0) { PC.line--; PC.col=-1; } result=EON;