--- parser3/src/classes/regex.C 2009/05/13 08:36:08 1.2 +++ parser3/src/classes/regex.C 2016/03/31 21:46:20 1.9 @@ -1,12 +1,10 @@ /** @file Parser: @b int parser class. - Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REGEX_C="$Date: 2009/05/13 08:36:08 $"; - #include "classes.h" #include "pa_vmethod_frame.h" @@ -14,31 +12,31 @@ 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.9 2016/03/31 21:46:20 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 -DECLARE_CLASS_VAR(regex, new MRegex, 0); +DECLARE_CLASS_VAR(regex, new MRegex); // 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();