--- parser3/src/classes/regex.C 2009/06/14 00:33:36 1.3 +++ parser3/src/classes/regex.C 2012/03/16 09:24:08 1.7 @@ -1,12 +1,10 @@ /** @file Parser: @b int parser class. - Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REGEX_C="$Date: 2009/06/14 00:33:36 $"; - #include "classes.h" #include "pa_vmethod_frame.h" @@ -14,15 +12,15 @@ static const char * const IDENT_REGEX_C= #include "pa_vint.h" #include "pa_vregex.h" +volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.7 2012/03/16 09:24:08 moko Exp $"; + // class class MRegex: public Methoded { public: // VStateless_class - Value* create_new_value(Pool&, HashStringValue*) { return new VRegex(); } + Value* create_new_value(Pool&) { return new VRegex(); } public: MRegex(); -public: // Methoded - bool used_directly() { return true; } }; // global variable @@ -32,13 +30,13 @@ DECLARE_CLASS_VAR(regex, new MRegex, 0); // methods static void _create(Request& r, MethodParams& params) { - Value& value=params.as_no_junction(0, "regexp must not be code"); + const String& pattern=params.as_string(0, "regexp must not be code"); VRegex& vregex=GET_SELF(r, VRegex); vregex.set(r.charsets.source(), - &value.as_string(), - params.count()>1?¶ms.as_no_junction(1, "options must not be code").as_string():0); + &pattern, + params.count()>1?¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE):0); vregex.compile();