--- parser3/src/classes/op.C 2016/10/04 13:23:46 1.236 +++ parser3/src/classes/op.C 2016/10/11 19:56:41 1.239 @@ -18,7 +18,7 @@ #include "pa_vclass.h" #include "pa_charset.h" -volatile const char * IDENT_OP_C="$Id: op.C,v 1.236 2016/10/04 13:23:46 moko Exp $"; +volatile const char * IDENT_OP_C="$Id: op.C,v 1.239 2016/10/11 19:56:41 moko Exp $"; // defines @@ -86,14 +86,14 @@ static void _if(Request& r, MethodParams do { bool condition=params.as_bool(i, "condition must be expression", r); if(condition) { - r.process_write(*params.get(i+1)); + r.process_write(params[i+1]); return; } i+=2; } while (i < max_param); if(i == max_param) - r.process_write(*params.get(i)); + r.process_write(params[i]); } String::Language get_untaint_lang(const String& lang_name){ @@ -243,7 +243,7 @@ static void _while(Request& r, MethodPar if(++endless_loop_count>=pa_loop_limit) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); - if(!r.process(vcondition, false/*don't intercept string*/).as_bool()) + if(!r.process(vcondition).as_bool()) break; Value& sv_processed=r.process(body_code); @@ -266,7 +266,7 @@ static void _while(Request& r, MethodPar if(++endless_loop_count>=pa_loop_limit) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); - if(!r.process(vcondition, false/*don't intercept string*/).as_bool()) + if(!r.process(vcondition).as_bool()) break; r.process_write(body_code); @@ -374,8 +374,7 @@ static void _for(Request& r, MethodParam static void _eval(Request& r, MethodParams& params) { Value& expr=params.as_junction(0, "need expression"); // evaluate expresion - Value& value_result=r.process(expr, - false/*don't intercept string*/).as_expr_result(); + Value& value_result=r.process(expr).as_expr_result(); if(params.count()>1) { const String& fmt=params.as_string(1, "fmt must be string").trim(); if(fmt.is_empty()){ @@ -450,7 +449,7 @@ static void _switch(Request& r, MethodPa Value& cases_code=params.as_junction(1, "switch cases must be code"); // execution of found ^case[...]{code} must be in context of ^switch[...]{code} // because of stacked WWrapper used there as wcontext - r.process(cases_code, true/*intercept_string*/); + r.process(cases_code); if(Value* selected_code=data->found? data->found: data->_default) r.write_pass_lang(r.process(*selected_code)); } @@ -937,7 +936,7 @@ VClassMAIN::VClassMAIN(): VClass(MAIN_CL add_native_method("continue", Method::CT_ANY, _continue, 0, 1, Method::CO_WITHOUT_FRAME); // ^for[i](from-number;to-number-inclusive){code}[delim] - add_native_method("for", Method::CT_ANY, _for, 3+1, 3+1+1, Method::CO_WITHOUT_WCONTEXT); + add_native_method("for", Method::CT_ANY, _for, 3+1, 3+1+1); // ^eval(expr) // ^eval(expr)[format]