update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -1,60 +0,0 @@
/*=============================================================================
Copyright (c) 2001-2014 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_SPIRIT_X3_NO_CASE_STRING_PARSE_APR_18_2014_1125PM)
#define BOOST_SPIRIT_X3_NO_CASE_STRING_PARSE_APR_18_2014_1125PM
#include <boost/spirit/home/x3/char/char.hpp>
#include <boost/spirit/home/x3/support/traits/move_to.hpp>
namespace boost { namespace spirit { namespace x3 { namespace detail
{
template <typename Char, typename Encoding>
struct no_case_string
{
typedef std::basic_string< Char > string_type;
typedef typename string_type::const_iterator const_iterator;
no_case_string(char_type const* str)
: lower(str)
, upper(str)
{
typename string_type::iterator loi = lower.begin();
typename string_type::iterator upi = upper.begin();
typedef typename Encoding::char_type encoded_char_type;
Encoding encoding;
for (; loi != lower.end(); ++loi, ++upi)
{
*loi = static_cast<char_type>(encoding.tolower(encoded_char_type(*loi)));
*upi = static_cast<char_type>(encoding.toupper(encoded_char_type(*upi)));
}
}
string_type lower;
string_type upper;
};
template <typename String, typename Iterator, typename Attribute>
inline bool no_case_string_parse(
String const& str
, Iterator& first, Iterator const& last, Attribute& attr)
{
typename String::const_iterator uc_i = str.upper.begin();
typename String::const_iterator uc_last = str.upper.end();
typename String::const_iterator lc_i = str.lower.begin();
Iterator i = first;
for (; uc_i != uc_last; ++uc_i, ++lc_i, ++i)
if (i == last || ((*uc_i != *i) && (*lc_i != *i)))
return false;
x3::traits::move_to(first, i, attr);
first = i;
return true;
}
}}}}
#endif

View File

@@ -10,6 +10,8 @@
#include <boost/call_traits.hpp>
#include <boost/assert.hpp>
#include <string>
namespace boost { namespace spirit { namespace x3 { namespace detail
{
// This file contains low level TST routines, not for

View File

@@ -11,7 +11,6 @@
#include <boost/spirit/home/x3/core/skip_over.hpp>
#include <boost/spirit/home/x3/string/detail/string_parse.hpp>
#include <boost/spirit/home/x3/support/no_case.hpp>
#include <boost/spirit/home/x3/string/detail/no_case_string_parse.hpp>
#include <boost/spirit/home/x3/support/utility/utf8.hpp>
#include <boost/spirit/home/support/char_encoding/ascii.hpp>
#include <boost/spirit/home/support/char_encoding/standard.hpp>
@@ -34,7 +33,7 @@ namespace boost { namespace spirit { namespace x3
!is_same<unused_type, attribute_type>::value;
static bool const handles_container = has_attribute;
literal_string(typename add_reference< typename add_const<String>::type >::type str)
constexpr literal_string(typename add_reference< typename add_const<String>::type >::type str)
: str(str)
{}
@@ -51,7 +50,7 @@ namespace boost { namespace spirit { namespace x3
namespace standard
{
inline literal_string<char const*, char_encoding::standard>
constexpr literal_string<char const*, char_encoding::standard>
string(char const* s)
{
return { s };
@@ -63,7 +62,7 @@ namespace boost { namespace spirit { namespace x3
return { s };
}
inline literal_string<char const*, char_encoding::standard, unused_type>
inline constexpr literal_string<char const*, char_encoding::standard, unused_type>
lit(char const* s)
{
return { s };
@@ -80,7 +79,7 @@ namespace boost { namespace spirit { namespace x3
#ifndef BOOST_SPIRIT_NO_STANDARD_WIDE
namespace standard_wide
{
inline literal_string<wchar_t const*, char_encoding::standard_wide>
constexpr literal_string<wchar_t const*, char_encoding::standard_wide>
string(wchar_t const* s)
{
return { s };
@@ -92,7 +91,7 @@ namespace boost { namespace spirit { namespace x3
return { s };
}
inline literal_string<wchar_t const*, char_encoding::standard_wide, unused_type>
constexpr literal_string<wchar_t const*, char_encoding::standard_wide, unused_type>
lit(wchar_t const* s)
{
return { s };
@@ -106,9 +105,38 @@ namespace boost { namespace spirit { namespace x3
}
#endif
#if defined(BOOST_SPIRIT_X3_UNICODE)
namespace unicode
{
constexpr literal_string<char32_t const*, char_encoding::unicode>
string(char32_t const* s)
{
return { s };
}
inline literal_string<std::basic_string<char32_t>, char_encoding::unicode>
string(std::basic_string<char32_t> const& s)
{
return { s };
}
constexpr literal_string<char32_t const*, char_encoding::unicode, unused_type>
lit(char32_t const* s)
{
return { s };
}
inline literal_string<std::basic_string<char32_t>, char_encoding::unicode, unused_type>
lit(std::basic_string<char32_t> const& s)
{
return { s };
}
}
#endif
namespace ascii
{
inline literal_string<wchar_t const*, char_encoding::ascii>
constexpr literal_string<wchar_t const*, char_encoding::ascii>
string(wchar_t const* s)
{
return { s };
@@ -120,7 +148,7 @@ namespace boost { namespace spirit { namespace x3
return { s };
}
inline literal_string<char const*, char_encoding::ascii, unused_type>
constexpr literal_string<char const*, char_encoding::ascii, unused_type>
lit(char const* s)
{
return { s };
@@ -136,7 +164,7 @@ namespace boost { namespace spirit { namespace x3
namespace iso8859_1
{
inline literal_string<wchar_t const*, char_encoding::iso8859_1>
constexpr literal_string<wchar_t const*, char_encoding::iso8859_1>
string(wchar_t const* s)
{
return { s };
@@ -148,7 +176,7 @@ namespace boost { namespace spirit { namespace x3
return { s };
}
inline literal_string<char const*, char_encoding::iso8859_1, unused_type>
constexpr literal_string<char const*, char_encoding::iso8859_1, unused_type>
lit(char const* s)
{
return { s };
@@ -180,7 +208,7 @@ namespace boost { namespace spirit { namespace x3
typedef type value_type;
static type call(char const* s)
static constexpr type call(char const* s)
{
return type(s);
}
@@ -199,7 +227,7 @@ namespace boost { namespace spirit { namespace x3
typedef type value_type;
static type call(wchar_t const* s)
static constexpr type call(wchar_t const* s)
{
return type(s);
}
@@ -218,7 +246,7 @@ namespace boost { namespace spirit { namespace x3
typedef type value_type;
static type call(char const* s)
static constexpr type call(char const* s)
{
return type(s);
}

View File

@@ -9,6 +9,8 @@
#include <boost/spirit/home/x3/string/detail/tst.hpp>
#include <string>
namespace boost { namespace spirit { namespace x3
{
struct tst_pass_through