A good start on ecma regex's. Maybe even feature complete, not sure yet. Also an unrelated fix to is_constructible thanks to Daniel Krugler.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@109479 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -252,4 +252,62 @@ __get_classname(const char* s, bool __icase)
|
||||
return r;
|
||||
}
|
||||
|
||||
template <>
|
||||
void
|
||||
__match_any_but_newline<char>::__exec(__state& __s) const
|
||||
{
|
||||
if (__s.__current_ != __s.__last_)
|
||||
{
|
||||
switch (*__s.__current_)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
__s.__do_ = __state::__reject;
|
||||
__s.__node_ = nullptr;
|
||||
break;
|
||||
default:
|
||||
__s.__do_ = __state::__accept_and_consume;
|
||||
++__s.__current_;
|
||||
__s.__node_ = this->first();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
__s.__do_ = __state::__reject;
|
||||
__s.__node_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void
|
||||
__match_any_but_newline<wchar_t>::__exec(__state& __s) const
|
||||
{
|
||||
if (__s.__current_ != __s.__last_)
|
||||
{
|
||||
switch (*__s.__current_)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
case 0x2028:
|
||||
case 0x2029:
|
||||
__s.__do_ = __state::__reject;
|
||||
__s.__node_ = nullptr;
|
||||
break;
|
||||
default:
|
||||
__s.__do_ = __state::__accept_and_consume;
|
||||
++__s.__current_;
|
||||
__s.__node_ = this->first();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
__s.__do_ = __state::__reject;
|
||||
__s.__node_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
Reference in New Issue
Block a user