--- parser3/src/classes/op.C 2019/11/22 23:11:24 1.253 +++ parser3/src/classes/op.C 2020/10/29 16:02:21 1.256 @@ -18,7 +18,7 @@ #include "pa_vclass.h" #include "pa_charset.h" -volatile const char * IDENT_OP_C="$Id: op.C,v 1.253 2019/11/22 23:11:24 moko Exp $"; +volatile const char * IDENT_OP_C="$Id: op.C,v 1.256 2020/10/29 16:02:21 moko Exp $"; // defines @@ -281,8 +281,9 @@ static void _while(Request& r, MethodPar static void _use(Request& r, MethodParams& params) { Value& vfile=params.as_no_junction(0, FILE_NAME_MUST_NOT_BE_CODE); - bool allow_class_replace=false; const String* use_origin=0; + bool allow_class_replace=false; + bool load_auto_p=false; if(params.count()==2) if(HashStringValue* options=params.as_hash(1)) { @@ -292,14 +293,19 @@ static void _use(Request& r, MethodParam String::Body key=i.key(); Value* value=i.value(); + if(key == "origin") { + valid_options++; + use_origin=&value->as_string(); + } + if(key == "replace") { valid_options++; allow_class_replace=r.process(*value).as_bool(); } - if(key == "origin") { + if(key == "main") { valid_options++; - use_origin=&value->as_string(); + load_auto_p=r.process(*value).as_bool(); } if(valid_options!=options->count()) @@ -313,7 +319,7 @@ static void _use(Request& r, MethodParam Temp_class_replace class_replace(r, allow_class_replace); - r.use_file(r.main_class, vfile.as_string(), use_origin); + r.use_file(r.main_class, vfile.as_string(), use_origin, load_auto_p); } static void set_skip(Request& r, Request::Skip askip) { @@ -333,7 +339,7 @@ static void _continue(Request& r, Method static void _return(Request& r, MethodParams& params) { VMethodFrame& caller=*r.get_method_frame()->caller(); if(params.count()) - r.put_element(caller, Symbols::RESULT_SYMBOL, ¶ms[0]); + r.put_element(caller, Symbols::RESULT_SYMBOL, &r.process(params[0])); r.set_skip_return(caller); } @@ -892,7 +898,7 @@ static void _sleep_operator(Request& r, pa_sleep((int)trunc(seconds), (int)trunc((seconds-trunc(seconds))*1000000)); } -#if defined(WIN32) && defined(_DEBUG) +#if defined(WIN32) && defined(_DEBUG) && !defined(_WIN64) # define PA_BPT static void _bpt(Request&, MethodParams&) { _asm int 3;