--- parser3/src/classes/op.C 2009/07/14 11:14:34 1.194 +++ parser3/src/classes/op.C 2009/07/29 05:01:33 1.196 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_OP_C="$Date: 2009/07/14 11:14:34 $"; +static const char * const IDENT_OP_C="$Date: 2009/07/29 05:01:33 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -38,15 +38,6 @@ public: VClassMAIN(); }; -// defines for globals - -#define CYCLE_DATA_NAME "CYCLE-DATA" - -// globals - -//^for & co -String cycle_data_name(CYCLE_DATA_NAME); - // defines for statics #define SWITCH_DATA_NAME "SWITCH-DATA" @@ -173,7 +164,7 @@ static void _process(Request& r, MethodP size_t options_index=index+1; HashStringValue* options=0; if(options_index - cycle_data_setter(r.classes_conf, cycle_data_name, /*any not null flag*/&r); + InCycle temp(r); Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); @@ -297,8 +287,7 @@ static void _use(Request& r, MethodParam } static void set_skip(Request& r, Request::Skip askip) { - void* data=r.classes_conf.get(cycle_data_name); - if(!data) + if(!r.get_in_cycle()) throw Exception(PARSER_RUNTIME, 0, "without cycle"); @@ -315,8 +304,7 @@ static void _continue(Request& r, Method } static void _for(Request& r, MethodParams& params) { - Temp_hash_value - cycle_data_setter(r.classes_conf, cycle_data_name, /*any not null flag*/&r); + InCycle temp(r); const String& var_name=params.as_string(0, "var name must be string"); int from=params.as_int(1, "from must be int", r);