--- parser3/src/classes/string.C 2003/09/29 10:09:35 1.127 +++ parser3/src/classes/string.C 2003/11/20 17:07:44 1.130 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/09/29 10:09:35 $"; +static const char * const IDENT_STRING_C="$Date: 2003/11/20 17:07:44 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -132,8 +132,7 @@ static void _pos(Request& r, MethodParam r.write_assign_lang(*new VInt((int)string.pos(substr.as_string()))); } -static void split_list(Request& r, - MethodParams& params, int paramIndex, +static void split_list(MethodParams& params, int paramIndex, const String& string, ArrayString& result) { Value& delim_value=params.as_no_junction(paramIndex, "delimiter must not be code"); @@ -158,7 +157,7 @@ static int split_options(const String* o {"r", "R", SPLIT_RIGHT, SPLIT_LEFT}, {"h", "H", SPLIT_HORIZONTAL, SPLIT_VERTICAL}, {"v", "V", SPLIT_VERTICAL, SPLIT_HORIZONTAL}, - {0} + {0, 0, 0, 0} }; int result=0; @@ -177,8 +176,7 @@ static int split_options(const String* o return result; } -static Table& split_vertical(Request& r, ArrayString& pieces, bool right) { - +static Table& split_vertical(ArrayString& pieces, bool right) { Table::columns_type columns(new ArrayString); *columns+=new String("piece"); @@ -201,7 +199,7 @@ static Table& split_vertical(Request& r, return table; } -static Table& split_horizontal(Request& r, ArrayString& pieces, bool right) { +static Table& split_horizontal(ArrayString& pieces, bool right) { Table& table=*new Table(Table::columns_type(0) /* nameless */); Table::element_type row(new ArrayString(pieces.count())); if(right) { // right @@ -221,7 +219,7 @@ static void split_with_options(Request& const String& string=GET_SELF(r, VString).string(); ArrayString pieces; - split_list(r, params, 0, string, pieces); + split_list(params, 0, string, pieces); if(!bits) { const String* options=0; @@ -233,8 +231,8 @@ static void split_with_options(Request& bool right=(bits & SPLIT_RIGHT) != 0; bool horizontal=(bits & SPLIT_HORIZONTAL) !=0; - Table& table=horizontal?split_horizontal(r, pieces, right) - :split_vertical(r, pieces, right); + Table& table=horizontal?split_horizontal(pieces, right) + :split_vertical(pieces, right); r.write_no_lang(*new VTable(&table)); } @@ -312,12 +310,13 @@ static void _match(Request& r, MethodPar String result; VTable* vtable=new VTable; - Replace_action_info info={0}; - info.request=&r; - info.src=&src; - info.dest=&result; - info.vtable=vtable; - info.replacement_code=&replacement_code; + Replace_action_info info={ + &r, + &src, + &result, + vtable, + &replacement_code + }; Temp_value_element temp_match_var( *replacement_code.get_junction()->method_frame, match_var_name, vtable); @@ -329,7 +328,7 @@ static void _match(Request& r, MethodPar } } -static void change_case(Request& r, MethodParams& params, +static void change_case(Request& r, MethodParams&, String::Change_case_kind kind) { const String& src=GET_SELF(r, VString).string(); @@ -357,7 +356,7 @@ public: got_cell(false), result(*new String) {} - bool add_column(SQL_Error& error, const char* str, size_t /*length*/) { + bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_column) { error=SQL_Error("parser.runtime", //statement_string, @@ -402,15 +401,13 @@ const String* sql_result_string(Request& if(params.count()>1) { Value& voptions=params.as_no_junction(1, "options must be hash, not code"); if(!voptions.is_string()) - if(options=voptions.get_hash()) { + if((options=voptions.get_hash())) { if(Value* vlimit=options->get(sql_limit_name)) limit=(ulong)r.process_to_value(*vlimit).as_double(); if(Value* voffset=options->get(sql_offset_name)) offset=(ulong)r.process_to_value(*voffset).as_double(); - if(default_code=options->get(sql_default_name)) { - if(Junction* default_junction=default_code->get_junction()) - ;//default_junction->change_context(statement.get_junction()); - else + if((default_code=options->get(sql_default_name))) { + if(!default_code->get_junction()) throw Exception("parser.runtime", 0, "default option must be code");