|
|
| version 1.109, 2002/04/22 14:25:41 | version 1.112, 2002/06/25 14:28:57 |
|---|---|
| Line 238 static void _match(Request& r, const Str | Line 238 static void _match(Request& r, const Str |
| result=new(pool) VBool(pool, matched); | result=new(pool) VBool(pool, matched); |
| r.write_assign_lang(*result); | r.write_assign_lang(*result); |
| } else { // replace | } else { // replace |
| char* src_cstr; | |
| const String& src=*r.self->get_string(); | const String& src=*r.self->get_string(); |
| Value& replacement_code=params->as_junction(2, "replacement param must be code"); | Value& replacement_code=params->as_junction(2, "replacement param must be code"); |
| Line 335 const String* sql_result_string(Request& | Line 334 const String* sql_result_string(Request& |
| if(Value *voffset=(Value *)options->get(*sql_offset_name)) | if(Value *voffset=(Value *)options->get(*sql_offset_name)) |
| offset=(ulong)r.process_to_value(*voffset).as_double(); | offset=(ulong)r.process_to_value(*voffset).as_double(); |
| if(default_code=(Value *)options->get(*sql_default_name)) { | if(default_code=(Value *)options->get(*sql_default_name)) { |
| if(!default_code->get_junction()) | if(Junction *default_junction=default_code->get_junction()) |
| default_junction->change_context(statement.get_junction()); | |
| else | |
| throw Exception("parser.runtime", | throw Exception("parser.runtime", |
| &method_name, | &method_name, |
| "default option must be code"); | "default option must be code"); |
| Line 426 static void _save(Request& r, const Stri | Line 427 static void _save(Request& r, const Stri |
| buf, strlen(buf), true, do_append); | buf, strlen(buf), true, do_append); |
| } | } |
| static void _optimize(Request& r, const String& method_name, MethodParams * /*params*/) { | static void _normalize(Request& r, const String& method_name, MethodParams * /*params*/) { |
| r.write_assign_lang(r.self->get_string()->join_chains(r.pool(), 0/*cstr*/)); | r.write_assign_lang(r.self->get_string()->join_chains(r.pool(), 0/*cstr*/)); |
| } | } |
| Line 480 MString::MString(Pool& apool) : Methoded | Line 481 MString::MString(Pool& apool) : Methoded |
| // ^string.save[file] | // ^string.save[file] |
| add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); | add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); |
| // ^string.optimize[] | // ^string.normalize[] |
| add_native_method("optimize", Method::CT_DYNAMIC, _optimize, 0, 0); | add_native_method("normalize", Method::CT_DYNAMIC, _normalize, 0, 0); |
| } | } |
| // global variable | // global variable |