--- parser3/src/classes/op.C 2010/06/16 11:29:17 1.200 +++ parser3/src/classes/op.C 2010/08/01 14:49:33 1.202 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_OP_C="$Date: 2010/06/16 11:29:17 $"; +static const char * const IDENT_OP_C="$Date: 2010/08/01 14:49:33 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -176,9 +176,7 @@ static void _process(Request& r, MethodP Value& voptions=params.as_no_junction(options_index, OPTIONS_MUST_NOT_BE_CODE); options=voptions.get_hash(); if(!options) - throw Exception(PARSER_RUNTIME, - 0, - "options must be hash"); + throw Exception(PARSER_RUNTIME, 0, OPTIONS_MUST_BE_HASH); } const String* main_alias=0; @@ -200,9 +198,7 @@ static void _process(Request& r, MethodP } if(valid_options!=options->count()) - throw Exception(PARSER_RUNTIME, - 0, - "called with invalid option"); + throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } uint processe_file_no=file_alias? @@ -224,10 +220,9 @@ static void _process(Request& r, MethodP // after restoring current-request-lang // maybe-execute @main[] if(main_method) { - // temporarily set method_frame's self to target_self - Temp_method_frame_self tmfs(*r.get_method_frame(), *target_self); - // execute! - r.execute(*main_method->parser_code); + VMethodFrame frame(*main_method, r.get_method_frame()->caller(), *target_self); + frame.empty_params(); + r.op_call_write(frame); } } @@ -294,7 +289,7 @@ static void _use(Request& r, MethodParam Value& vfile=params.as_no_junction(0, FILE_NAME_MUST_NOT_BE_CODE); // _use could be called from the parser3 method only, so caller is always defined - r.use_file(r.main_class, vfile.as_string(), r.get_method_filename(r.get_method_frame()->caller()->junction.method)); + r.use_file(r.main_class, vfile.as_string(), r.get_method_filename(&r.get_method_frame()->caller()->method)); } static void set_skip(Request& r, Request::Skip askip) {