summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/regex
diff options
context:
space:
mode:
authorAndrey Khalyavin <[email protected]>2022-04-21 13:17:27 +0300
committerAndrey Khalyavin <[email protected]>2022-04-21 13:17:27 +0300
commitddddb65b4f1f643c2d11077c6af35df1d6ab1656 (patch)
treec66d94470f9e2f5840a36474a656755c0af4db20 /contrib/libs/cxxsupp/libcxx/include/regex
parentf818c45c008cf20b6ac46f7c5f9a0cd5095ccca3 (diff)
Update libc++ to 429a717e (20 Jan 2022).
Notable changes: * use _LIBCPP_DEBUG_ASSERT in unordered_map and vector headers * use reserved identifiers for template parameters * fix category of fs::path::iterator * introduce __debug_db_insert_i() for debug checks to support compile-time evaluation * add specializations of basic_common_reference and common_type for tuple * fix std::lognormal_distribution::param_type * add _LIBCPP_HIDE_FROM_ABI to in_in_result conversion operators * replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in move_iterator.h * fix __simple_view concept in std::ranges * add some ASCII/EBCDIC support for z/OS ref:b0e68cbe142a3f06a8804f247119b5eb0a455a39
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/regex')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/regex38
1 files changed, 35 insertions, 3 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex
index 8203c81659c..59b2c9a2339 100644
--- a/contrib/libs/cxxsupp/libcxx/include/regex
+++ b/contrib/libs/cxxsupp/libcxx/include/regex
@@ -1310,19 +1310,51 @@ regex_traits<_CharT>::isctype(char_type __c, char_class_type __m) const
return (__c == '_' && (__m & __regex_word));
}
+inline _LIBCPP_INLINE_VISIBILITY
+bool __is_07(unsigned char c)
+{
+ return (c & 0xF8u) ==
+#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
+ 0xF0;
+#else
+ 0x30;
+#endif
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool __is_89(unsigned char c)
+{
+ return (c & 0xFEu) ==
+#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
+ 0xF8;
+#else
+ 0x38;
+#endif
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+unsigned char __to_lower(unsigned char c)
+{
+#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
+ return c & 0xBF;
+#else
+ return c | 0x20;
+#endif
+}
+
template <class _CharT>
int
regex_traits<_CharT>::__regex_traits_value(unsigned char __ch, int __radix)
{
- if ((__ch & 0xF8u) == 0x30) // '0' <= __ch && __ch <= '7'
+ if (__is_07(__ch)) // '0' <= __ch && __ch <= '7'
return __ch - '0';
if (__radix != 8)
{
- if ((__ch & 0xFEu) == 0x38) // '8' <= __ch && __ch <= '9'
+ if (__is_89(__ch)) // '8' <= __ch && __ch <= '9'
return __ch - '0';
if (__radix == 16)
{
- __ch |= 0x20; // tolower
+ __ch = __to_lower(__ch); // tolower
if ('a' <= __ch && __ch <= 'f')
return __ch - ('a' - 10);
}