--- parser3/src/classes/string.C 2003/03/05 11:57:36 1.125.2.13 +++ parser3/src/classes/string.C 2003/03/05 16:58:24 1.125.2.14 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/03/05 11:57:36 $"; +static const char* IDENT_STRING_C="$Date: 2003/03/05 16:58:24 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -312,20 +312,18 @@ static void _match(Request& r, StringPtr Temp_lang temp_lang(r, String::UL_PASS_APPENDED); StringPtr src=GET_SELF(r, VString).string(); + bool just_matched; if(params->count()<3) { // search - bool was_global; TablePtr table=src->match(r.charsets.source(), method_name, *regexp->as_string(&pool), options, search_action, 0, - &was_global); + just_matched); ValuePtr result; - // matched - // not (just matched[3=pre/match/post], no substrings) or Global search - if(was_global || (table && table->columns()->count()>3)) - result=ValuePtr(new VTable(table/*TODO: clone this when table would be stacked!*/)); // table of pre/match/post+substrings + if(table) + result=ValuePtr(new VTable(table)); // table of pre/match/post+substrings else - result=ValuePtr(new VBool(table)); + result=ValuePtr(new VBool(just_matched)); r.write_assign_lang(result); } else { // replace ValuePtr replacement_code=params->as_junction(2, "replacement param must be code"); @@ -345,7 +343,8 @@ static void _match(Request& r, StringPtr src->match(r.charsets.source(), method_name, *r.process_to_string(regexp), options, - replace_action, &info); + replace_action, &info, + just_matched); r.write_assign_lang(result); } }