--- parser3/src/classes/Attic/root.C 2001/03/13 11:52:44 1.37 +++ parser3/src/classes/Attic/root.C 2001/03/13 17:17:25 1.40 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: root.C,v 1.37 2001/03/13 11:52:44 paf Exp $ + $Id: root.C,v 1.40 2001/03/13 17:17:25 paf Exp $ */ #include @@ -43,7 +43,7 @@ static void _untaint(Request& r, const S String::Untaint_lang lang=static_cast( untaint_lang_name2enum->get_int(lang_name)); if(!lang) - R_THROW(0, 0, + RTHROW(0, 0, &lang_name, "invalid untaint language"); @@ -72,7 +72,7 @@ static void _process(Request& r, const S strncpy(place, MAX_STRING, method_name.cstr()); #endif - VClass& self_class=*r.self->get_class(); + VStateless_class& self_class=*r.self->get_class(); { // temporary zero @main so to maybe-replace it in processed code Temp_method temp_method(self_class, *main_method_name, 0); @@ -114,7 +114,7 @@ static void _while(Request& r, const Str int endless_loop_count=0; while(true) { if(++endless_loop_count>=1973) // endless loop? - R_THROW(0, 0, + RTHROW(0, 0, &method_name, "endless loop detected"); @@ -159,7 +159,7 @@ static void _for(Request& r, const Strin int endless_loop_count=0; for(int i=from; i<=to; i++) { if(++endless_loop_count>=2001) // endless loop? - R_THROW(0, 0, + RTHROW(0, 0, &method_name, "endless loop detected"); vint->set_int(i); @@ -195,7 +195,7 @@ static void _eval(Request& r, const Stri string->APPEND_CONST(format(pool, result->get_double(), fmt.as_string().cstr())); result=new(pool) VString(*string); } - r.wcontext->write(*result, String::Untaint_lang::NO /*always object, not string*/); + r.write_no_lang(*result); } @@ -215,7 +215,7 @@ static void double_one_op( method_name, "parameter must be expression"); Value& result=*new(pool) VDouble(pool, (*func)(r.process(param).get_double())); - r.wcontext->write(result, String::Untaint_lang::NO /*always object, not string*/); + r.write_no_lang(result); } static void _round(Request& r, const String& method_name, Array *params) { @@ -238,7 +238,9 @@ static void _sign(Request& r, const Stri double_one_op(r, method_name, params, &sign); } -void initialize_root_class(Pool& pool, VClass& vclass) { +// initialize + +void initialize_root_class(Pool& pool, VStateless_class& vclass) { // ^if(condition){code-when-true} // ^if(condition){code-when-true}{code-when-false} vclass.add_native_method("if", _if, 2, 3);