--- parser3/src/classes/string.C 2016/11/01 23:10:41 1.233 +++ parser3/src/classes/string.C 2018/01/19 16:47:35 1.237 @@ -1,7 +1,7 @@ /** @file Parser: @b string parser class. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -20,7 +20,7 @@ #include "pa_vregex.h" #include "pa_charsets.h" -volatile const char * IDENT_STRING_C="$Id: string.C,v 1.233 2016/11/01 23:10:41 moko Exp $"; +volatile const char * IDENT_STRING_C="$Id: string.C,v 1.237 2018/01/19 16:47:35 moko Exp $"; // class @@ -381,15 +381,10 @@ static void _match(Request& r, MethodPar if(Value* value=regexp.as(VREGEX_TYPE)){ if(options && options->is_defined()) - throw Exception(PARSER_RUNTIME, - 0, - "you can not specify regex-object and options together" - ); + throw Exception(PARSER_RUNTIME, 0, "you can not specify regex-object and options together"); vregex=static_cast(value); } else { - vregex=new VRegex(r.charsets.source(), - ®exp.as_string(), - (options)?(&options->as_string()):0); + vregex=new VRegex(r.charsets.source(), ®exp.as_string(), (options) ? (&options->as_string()) : 0); vregex->study(); vrcleaner.vregex=vregex; } @@ -398,9 +393,7 @@ static void _match(Request& r, MethodPar int matches_count=0; if(params_count<3) { // search - Table* table=src.match(vregex, - search_action, 0, - matches_count); + Table* table=src.match(vregex, search_action, 0, matches_count); if(table){ r.write(*new VTable(table)); @@ -504,7 +497,7 @@ public: result=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */ ); return false; } catch(...) { - error=SQL_Error("exception occured in String_sql_event_handlers::add_row_cell"); + error=SQL_Error("exception occurred in String_sql_event_handlers::add_row_cell"); return true; } } @@ -826,12 +819,12 @@ MString::MString(): Methoded("string") { // ^string.split[delim][options] // ^string.split[delim][options][column name] add_native_method("split", Method::CT_DYNAMIC, _split, 1, 3); - // old names for backward compatibility - // ^string.lsplit[delim] - add_native_method("lsplit", Method::CT_DYNAMIC, _lsplit, 1, 1); - // ^string.rsplit[delim] - add_native_method("rsplit", Method::CT_DYNAMIC, _rsplit, 1, 1); - + // old names for backward compatibility + // ^string.lsplit[delim] + add_native_method("lsplit", Method::CT_DYNAMIC, _lsplit, 1, 1); + // ^string.rsplit[delim] + add_native_method("rsplit", Method::CT_DYNAMIC, _rsplit, 1, 1); + // ^string.match[regexp][options] // ^string.match[regexp][options]{replacement-code} // ^string.match[regexp][options]{replacement-code}{code-if-nothing-is-found}