|
|
| version 1.62, 2001/07/13 12:13:50 | version 1.64, 2001/07/20 09:40:46 |
|---|---|
| Line 59 static void _double(Request& r, const St | Line 59 static void _double(Request& r, const St |
| Temp_lang temp_lang(r, String::UL_PASS_APPENDED); | Temp_lang temp_lang(r, String::UL_PASS_APPENDED); |
| char *buf=format(pool, r.self->as_double(), r.process(fmt).as_string().cstr()); | char *buf=format(pool, r.self->as_double(), r.process(fmt).as_string().cstr()); |
| r.write_no_lang(String(pool, buf)); | String result(pool); |
| result.APPEND_CLEAN(buf, 0, | |
| method_name.origin().file, | |
| method_name.origin().line); | |
| r.write_no_lang(result); | |
| } | } |
| static void _left(Request& r, const String&, MethodParams *params) { | static void _left(Request& r, const String&, MethodParams *params) { |
| Line 210 static void _match(Request& r, const Str | Line 214 static void _match(Request& r, const Str |
| Temp_lang temp_lang(r, String::UL_PASS_APPENDED); | Temp_lang temp_lang(r, String::UL_PASS_APPENDED); |
| Table *table; | Table *table; |
| if(params->size()<3) { // search | if(params->size()<3) { // search |
| bool was_global; | |
| bool matched=src.match(r.pcre_tables, | bool matched=src.match(r.pcre_tables, |
| &method_name, | &method_name, |
| regexp.as_string(), options, | regexp.as_string(), options, |
| &table, | &table, |
| search_action, 0); | search_action, 0, |
| &was_global); | |
| // matched | // matched |
| if(table->columns()->size()==3 && // just matched[3=pre/match/post], no substrings | // not (just matched[3=pre/match/post], no substrings) or Global search |
| table->size()<=1) // just one row, not /g_lobal search | if(table->columns()->size()>3 || was_global) |
| result=new(pool) VBool(pool, matched); | result=new(pool) VTable(pool, table); // table of pre/match/post+substrings |
| else // table of pre/match/post+substrings | else |
| result=new(pool) VTable(pool, table); | result=new(pool) VBool(pool, matched); |
| } else { // replace | } else { // replace |
| Value& replacement_code=params->as_junction(2, "replacement code must be code"); | Value& replacement_code=params->as_junction(2, "replacement code must be code"); |