--- parser3/src/classes/op.C 2003/03/03 13:44:25 1.127.2.18 +++ parser3/src/classes/op.C 2003/03/08 16:43:45 1.127.2.21 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_OP_C="$Date: 2003/03/03 13:44:25 $"; +static const char* IDENT_OP_C="$Date: 2003/03/08 16:43:45 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -16,6 +16,7 @@ static const char* IDENT_OP_C="$Date: 20 #include "pa_sql_connection.h" #include "pa_vdate.h" #include "pa_vmethod_frame.h" +#include "pa_vclass.h" // limits @@ -508,7 +509,7 @@ StringPtr cache_get(Pool& pool, Charset& return result; } - return 0; + return StringPtr(0); } static time_t as_expires(Request& r, StringPtr method_name, MethodParams* params, int index, time_t now) { @@ -695,7 +696,7 @@ static void _throw_operator(Request& r, throw Exception(type, source?source:method_name, - "%s", comment?comment:""); + "%s", comment?comment.get():""); } else throw Exception("parser.runtime", method_name, @@ -705,15 +706,27 @@ static void _throw_operator(Request& r, StringPtr source=params->as_string(1, "source must be string"); CharPtr comment=params->count()>2? params->as_string(2, "comment must be string")->cstr() :CharPtr(0); - throw Exception(type, source, "%s", comment?comment:""); + throw Exception(type, source, "%s", comment?comment.get():""); } } - + +#if defined(WIN32) && defined(_DEBUG) +# define PA_BPT +static void _bpt(Request& r, StringPtr method_name, MethodParams* params) { + _asm int 3; +} +#endif + // constructor VClassMAIN::VClassMAIN(): VClass() { set_name(StringPtr(new String(MAIN_CLASS_NAME))); +#ifdef PA_BPT + // ^bpt[] + add_native_method("bpt", Method::CT_ANY, _bpt, 0, 0); +#endif + // ^if(condition){code-when-true} // ^if(condition){code-when-true}{code-when-false} add_native_method("if", Method::CT_ANY, _if, 2, 3);