--- parser3/src/main/compile.y 2016/07/20 16:36:49 1.283 +++ parser3/src/main/compile.y 2016/11/22 22:31:38 1.286 @@ -8,7 +8,7 @@ */ -volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.283 2016/07/20 16:36:49 moko Exp $"; +volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.286 2016/11/22 22:31:38 moko Exp $"; /** @todo parser4: @@ -143,7 +143,7 @@ static const VString vempty; %% all: one_big_piece { - Method* method=new Method(Method::CT_ANY, 0, 0 /*min, max numbered_params_count*/, 0 /*param_names*/, 0 /*local_names*/, $1 /*parser_code*/, 0 /*native_code*/); + Method* method=new Method(Method::CT_ANY, 0, 0 /*min, max numbered_params_count*/, 0 /*param_names*/, 0 /*local_names*/, $1 /*parser_code*/, 0 /*native_code*/, PC.cclass->is_vars_local()); PC.cclass->set_method(PC.alias_method(main_method_name), method); } | methods; @@ -178,8 +178,7 @@ control_method: '@' STRING '\n' } else if(command==USE_CONTROL_METHOD_NAME) { CLASS_ADD; for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE){ - PC.request.use_file(PC.request.main_class, LA2S(*strings_code, i)->trim(String::TRIM_END), - PC.request.get_used_filename(PC.file_no), strings_code->get(i+1).origin); + PC.request.use_file(LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filename(PC.file_no), strings_code->get(i+1).origin); } } else if(command==BASE_NAME) { if(PC.append){ @@ -261,7 +260,8 @@ code_method: '@' STRING bracketed_maybe_ YYSTYPE locals_names_code=$4; ArrayString* locals_names=0; - bool all_vars_local=false; + bool all_vars_local=PC.cclass->is_vars_local(); + if(int size=locals_names_code->count()) { locals_names=new ArrayString; for(int i=0; iis_vars_local()) - all_vars_local=true; Method* method=new Method( //name, @@ -466,7 +464,6 @@ construct_square: '[' { ; construct_round: '(' expr_value ')' { $$=N(); - O(*$$, OP::OP_PREPARE_TO_EXPRESSION); // stack: context, name P(*$$, *$2); // stack: context, name, value O(*$$, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ @@ -609,7 +606,6 @@ store_expr_param_part: expr_value { $$=expr_code; } else { YYSTYPE code=N(); - O(*code, OP::OP_PREPARE_TO_EXPRESSION); P(*code, *expr_code); O(*code, OP::OP_WRITE_EXPR_RESULT); $$=N();