--- parser3/src/classes/op.C 2007/06/06 14:21:19 1.169 +++ parser3/src/classes/op.C 2007/08/20 10:37:21 1.172 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_OP_C="$Date: 2007/06/06 14:21:19 $"; +static const char * const IDENT_OP_C="$Date: 2007/08/20 10:37:21 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -243,7 +243,8 @@ static void _while(Request& r, MethodPar Temp_hash_value cycle_data_setter(r.classes_conf, cycle_data_name, /*any not null flag*/&r); - Value& vcondition=params[0].is_evaluated_expr()?params[0]:params.as_junction(0, "condition must be bool or expression"); + Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); + Value& body_code=params.as_junction(1, "body must be code"); Value* delim_maybe_code=params.count()>2?¶ms[2]:0; @@ -277,7 +278,7 @@ 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"); + Value& vfile=params.as_no_junction(0, FILE_NAME_MUST_NOT_BE_CODE); r.use_file(r.main_class, vfile.as_string()); } @@ -707,7 +708,7 @@ static void _cache(Request& r, MethodPar "invalid number of parameters"); // file_spec, expires, body code - const String& file_spec=r.absolute(params.as_string(0, "filespec must be string")); + const String& file_spec=as_file_spec(r, params, 0); Cache_scope scope={as_expires(r, params, 1, now), 0};