|
|
| version 1.35, 2001/04/04 10:50:33 | version 1.37, 2001/04/08 13:11:15 |
|---|---|
| Line 46 static void _double(Request& r, const St | Line 46 static void _double(Request& r, const St |
| Value& fmt=*static_cast<Value *>(params->get(0)); | Value& fmt=*static_cast<Value *>(params->get(0)); |
| // forcing {this param type} | // forcing {this param type} |
| r.fail_if_junction_(false, fmt, method_name, "fmt must be junction"); | r.fail_if_junction_(false, fmt, method_name, "fmt must be code"); |
| 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()); |
| Line 87 static void _pos(Request& r, const Strin | Line 87 static void _pos(Request& r, const Strin |
| Value& substr=*static_cast<Value *>(params->get(0)); | Value& substr=*static_cast<Value *>(params->get(0)); |
| // forcing [this param type] | // forcing [this param type] |
| r.fail_if_junction_(true, substr, method_name, "substr must not be junction"); | r.fail_if_junction_(true, substr, method_name, "substr must not be code"); |
| const String& string=*static_cast<VString *>(r.self)->get_string(); | const String& string=*static_cast<VString *>(r.self)->get_string(); |
| r.write_assign_lang(*new(pool) VInt(pool, string.pos(substr.as_string()))); | r.write_assign_lang(*new(pool) VInt(pool, string.pos(substr.as_string()))); |
| Line 100 static void split_list(Request& r, const | Line 100 static void split_list(Request& r, const |
| Value& delim_value=*static_cast<Value *>(params->get(0)); | Value& delim_value=*static_cast<Value *>(params->get(0)); |
| // forcing [this param type] | // forcing [this param type] |
| r.fail_if_junction_(true, delim_value, method_name, "delimiter must not be junction"); | r.fail_if_junction_(true, delim_value, method_name, "delimiter must not be code"); |
| string.split(result, 0, delim_value.as_string(), String::UL_CLEAN, -1); | string.split(result, 0, delim_value.as_string(), String::UL_CLEAN, -1); |
| } | } |
| Line 154 static void replace_action(Table& table, | Line 154 static void replace_action(Table& table, |
| if(row) { // begin&middle | if(row) { // begin&middle |
| // piece from last match['start'] to beginning of this match['finish'] | // piece from last match['start'] to beginning of this match['finish'] |
| if(start!=finish) | if(start!=finish) |
| ai.dest->append(ai.src->mid(start, finish), String::UL_PASS_APPENDED);//ai.dest->APPEND_CONST("-"); | *ai.dest << ai.src->mid(start, finish);//ai.dest->APPEND_CONST("-"); |
| // store found parts in one-record Vtable | // store found parts in one-record Vtable |
| if(table.size()) // middle | if(table.size()) // middle |
| table.put(0, row); | table.put(0, row); |
| Line 170 static void replace_action(Table& table, | Line 170 static void replace_action(Table& table, |
| /* | /* |
| ai.dest->APPEND_CONST("("); | ai.dest->APPEND_CONST("("); |
| ai.dest->append(*(String *)row->get(1/*match* /), String::UL_PASS_APPENDED); | *ai.dest << *(String *)row->get(1/*match* /); |
| ai.dest->APPEND_CONST(")"); | ai.dest->APPEND_CONST(")"); |
| */ | */ |
| ai.dest->append(replaced.as_string(), String::UL_PASS_APPENDED); | *ai.dest << replaced.as_string(); |
| } | } |
| ai.post_match=(String *)row->get(2/*post_match*/); | ai.post_match=(String *)row->get(2/*post_match*/); |
| } else // end | } else // end |
| ai.dest->append(*ai.post_match, String::UL_PASS_APPENDED); | *ai.dest << *ai.post_match; |
| } | } |
| /** search/replace | /** search/replace |
| Line 190 static void _match(Request& r, const Str | Line 190 static void _match(Request& r, const Str |
| Value& regexp=*static_cast<Value *>(params->get(0)); | Value& regexp=*static_cast<Value *>(params->get(0)); |
| // forcing [this param type] | // forcing [this param type] |
| r.fail_if_junction_(true, regexp, method_name, "regexp must not be junction"); | r.fail_if_junction_(true, regexp, method_name, "regexp must not be code"); |
| const String *options=0; | const String *options=0; |
| if(params->size()>1) { | if(params->size()>1) { |
| Value& value=*static_cast<Value *>(params->get(1)); | Value& value=*static_cast<Value *>(params->get(1)); |
| // forcing {this param type} | // forcing {this param type} |
| r.fail_if_junction_(true, value, method_name, "options must not be junction"); | r.fail_if_junction_(true, value, method_name, "options must not be code"); |
| options=&value.as_string(); | options=&value.as_string(); |
| } | } |
| Line 220 static void _match(Request& r, const Str | Line 220 static void _match(Request& r, const Str |
| Value& replacement_code=*static_cast<Value *>(params->get(2)); | Value& replacement_code=*static_cast<Value *>(params->get(2)); |
| // forcing {this param type} | // forcing {this param type} |
| r.fail_if_junction_(false, replacement_code, | r.fail_if_junction_(false, replacement_code, |
| method_name, "replacement code must be junction"); | method_name, "replacement code must be code"); |
| String& dest=*new(pool) String(pool); | String& dest=*new(pool) String(pool); |
| Replace_action_info replace_action_info={ | Replace_action_info replace_action_info={ |