--- parser3/src/classes/string.C 2001/08/31 09:26:12 1.72 +++ parser3/src/classes/string.C 2001/09/06 06:11:13 1.74 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: string.C,v 1.72 2001/08/31 09:26:12 parser Exp $"; +static const char *RCSId="$Id: string.C,v 1.74 2001/09/06 06:11:13 parser Exp $"; #include "classes.h" #include "pa_request.h" @@ -196,13 +196,14 @@ static void search_action(Table& table, table+=row; } -/// used by string: _match / replace_action +#ifndef DOXYGEN struct Replace_action_info { Request *request; const String *origin; const String *src; String *dest; Value *replacement_code; const String *post_match; }; +#endif static void replace_action(Table& table, Array *row, int start, int finish, void *info) { Replace_action_info& ai=*static_cast(info); @@ -355,16 +356,17 @@ const String* sql_result_string(Request& ulong limit=0; ulong offset=0; if(params->size()>1) { - Value& options_param=params->as_no_junction(1, "options must be hash, not code"); - if(options=options_param.get_hash()) { - if(Value *vlimit=(Value *)options->get(*sql_limit_name)) - limit=(ulong)r.process(*vlimit).as_double(); - if(Value *voffset=(Value *)options->get(*sql_offset_name)) - offset=(ulong)r.process(*voffset).as_double(); - } else - PTHROW(0, 0, - &method_name, - "options must be hash"); + Value& voptions=params->as_no_junction(1, "options must be hash, not code"); + if(voptions.is_defined()) + if(options=voptions.get_hash()) { + if(Value *vlimit=(Value *)options->get(*sql_limit_name)) + limit=(ulong)r.process(*vlimit).as_double(); + if(Value *voffset=(Value *)options->get(*sql_offset_name)) + offset=(ulong)r.process(*voffset).as_double(); + } else + PTHROW(0, 0, + &method_name, + "options must be hash"); } else options=0;