Remove more old code and enable standalone mode.

This commit is contained in:
jzmaddock
2020-12-10 16:47:08 +00:00
parent c902bed6a3
commit dba05b4d5b
18 changed files with 94 additions and 2333 deletions

View File

@ -736,14 +736,14 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state)
case syntax_element_long_set_rep:
// set the state_id of this repeat:
static_cast<re_repeat*>(state)->state_id = m_repeater_id++;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case syntax_element_alt:
std::memset(static_cast<re_alt*>(state)->_map, 0, sizeof(static_cast<re_alt*>(state)->_map));
static_cast<re_alt*>(state)->can_be_null = 0;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case syntax_element_jump:
static_cast<re_jump*>(state)->alt.p = getaddress(static_cast<re_jump*>(state)->alt.i, state);
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
if(state->next.i)
state->next.p = getaddress(state->next.i, state);
@ -947,7 +947,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
e.raise();
}
}
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
state = state->next.p;
}
@ -1170,13 +1170,13 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
}
m_recursion_checks[recursion_sub] |= 1u;
// can't handle nested recursion here...
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
}
case syntax_element_backref:
// can be null, and any character can match:
if(pnull)
*pnull |= mask;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case syntax_element_wild:
{
// can't be null, any character can match:
@ -1383,7 +1383,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
state = state->next.p->next.p;
break;
}
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
state = state->next.p;
}
@ -1569,7 +1569,7 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
case syntax_element_long_set_rep:
if(this->m_has_backrefs == 0)
static_cast<re_repeat*>(state)->leading = true;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
return;
}

View File

@ -411,7 +411,7 @@ bool basic_regex_parser<charT, traits>::parse_extended()
while((m_position != m_end) && !is_separator(*m_position++)){}
return true;
}
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
result = parse_literal();
break;
@ -675,7 +675,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
{
case 'w':
negate = false;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case 'W':
{
basic_char_set<charT, traits> char_set;
@ -692,7 +692,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape()
}
case 's':
negate = false;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case 'S':
return add_emacs_code(negate);
case 'c':
@ -724,7 +724,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
{
case regex_constants::escape_type_not_class:
negate = true;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case regex_constants::escape_type_class:
{
escape_type_class_jump:
@ -794,7 +794,7 @@ escape_type_class_jump:
break;
case regex_constants::escape_type_not_property:
negate = true;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case regex_constants::escape_type_property:
{
++m_position;
@ -953,7 +953,7 @@ escape_type_class_jump:
case regex_constants::escape_type_control_v:
if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
goto escape_type_class_jump;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
this->append_literal(unescape_character());
break;
@ -2080,7 +2080,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
{
case regex_constants::syntax_or:
m_mark_reset = m_mark_count;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
case regex_constants::syntax_colon:
//
// a non-capturing mark:

View File

@ -90,9 +90,9 @@ public:
parser_buf() : base_type() { setbuf(0, 0); }
const charT* getnext() { return this->gptr(); }
protected:
std::basic_streambuf<charT, traits>* setbuf(char_type* s, streamsize n) BOOST_OVERRIDE;
typename parser_buf<charT, traits>::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which) BOOST_OVERRIDE;
typename parser_buf<charT, traits>::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) BOOST_OVERRIDE;
std::basic_streambuf<charT, traits>* setbuf(char_type* s, streamsize n) override;
typename parser_buf<charT, traits>::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which) override;
typename parser_buf<charT, traits>::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) override;
private:
parser_buf& operator=(const parser_buf&);
parser_buf(const parser_buf&);
@ -214,11 +214,11 @@ std::locale cpp_regex_traits_base<charT>::imbue(const std::locale& l)
{
std::locale result(m_locale);
m_locale = l;
m_pctype = &BOOST_USE_FACET(std::ctype<charT>, l);
m_pctype = &std::use_facet<std::ctype<charT>>(l);
#ifndef BOOST_NO_STD_MESSAGES
m_pmessages = BOOST_HAS_FACET(std::messages<charT>, l) ? &BOOST_USE_FACET(std::messages<charT>, l) : 0;
m_pmessages = std::has_facet<std::messages<charT> >(l) ? &std::use_facet<std::messages<charT> >(l) : 0;
#endif
m_pcollate = &BOOST_USE_FACET(std::collate<charT>, l);
m_pcollate = &std::use_facet<std::collate<charT> >(l);
return result;
}
@ -394,11 +394,11 @@ public:
typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
typedef typename std::ctype<charT>::mask native_mask_type;
typedef typename std::make_unsigned<native_mask_type>::type unsigned_native_mask_type;
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24);
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25);
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 26);
BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 1u << 27);
BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 1u << 28);
static const char_class_type mask_blank = 1u << 24;
static const char_class_type mask_word = 1u << 25;
static const char_class_type mask_unicode = 1u << 26;
static const char_class_type mask_horizontal = 1u << 27;
static const char_class_type mask_vertical = 1u << 28;
typedef std::basic_string<charT> string_type;
typedef charT char_type;
@ -928,7 +928,7 @@ std::intmax_t cpp_regex_traits<charT>::toi(const charT*& first, const charT* las
std::basic_istream<charT> is(&sbuf); // stream for parsing numbers.
// we do NOT want to parse any thousands separators inside the stream:
last = std::find(first, last, BOOST_USE_FACET(std::numpunct<charT>, is.getloc()).thousands_sep());
last = std::find(first, last, std::use_facet<std::numpunct<charT>>(is.getloc()).thousands_sep());
sbuf.pubsetbuf(const_cast<charT*>(static_cast<const charT*>(first)), static_cast<std::streamsize>(last-first));
is.clear();

View File

@ -26,6 +26,19 @@
#include <boost/regex/v5/match_flags.hpp>
#include <boost/regex/v5/error_type.hpp>
#ifndef BOOST_REGEX_STANDALONE
#if !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
# define BOOST_LIB_NAME boost_regex
# if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
# define BOOST_DYN_LINK
# endif
# ifdef BOOST_REGEX_DIAG
# define BOOST_LIB_DIAGNOSTIC
# endif
# include <boost/config/auto_link.hpp>
#endif
#endif
#ifdef __cplusplus
#include <cstddef>
#else

View File

@ -30,20 +30,16 @@ namespace detail{
template <class I>
struct is_random_imp
{
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
private:
typedef typename std::iterator_traits<I>::iterator_category cat;
public:
BOOST_STATIC_CONSTANT(bool, value = (std::is_convertible<cat*, std::random_access_iterator_tag*>::value));
#else
BOOST_STATIC_CONSTANT(bool, value = false);
#endif
static const bool value = (std::is_convertible<cat*, std::random_access_iterator_tag*>::value);
};
template <class I>
struct is_random_pointer_imp
{
BOOST_STATIC_CONSTANT(bool, value = true);
static const bool value = true;
};
template <bool is_pointer_type>
@ -76,7 +72,7 @@ private:
typedef typename selector::template rebind<I> bound_type;
typedef typename bound_type::type answer;
public:
BOOST_STATIC_CONSTANT(bool, value = answer::value);
static const bool value = answer::value;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION

View File

@ -35,7 +35,7 @@ namespace boost{
// class regbase
// handles error codes and flags
//
class BOOST_REGEX_DECL regbase
class regbase
{
public:
enum flag_type_

View File

@ -279,7 +279,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
break;
}
// not a special character:
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
put(*m_position);
++m_position;
@ -350,7 +350,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
case '{':
have_brace = true;
++m_position;
BOOST_FALLTHROUGH;
BOOST_REGEX_FALLTHROUGH;
default:
// see if we have a number:
{
@ -938,7 +938,7 @@ private:
static O out;
static boost::regex_constants::match_flag_type flags;
public:
BOOST_STATIC_CONSTANT(int, value = sizeof(check_is_formatter(f(m), f(m, out), f(m, out, flags))));
static const int value = sizeof(check_is_formatter(f(m), f(m, out), f(m, out, flags)));
};
template <class F, class M, class O>

View File

@ -38,6 +38,7 @@
#include <type_traits>
#include <cstdint>
#include <cctype>
#include <cwctype>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{

View File

@ -277,11 +277,11 @@ class w32_regex_traits_implementation : public w32_regex_traits_char_layer<charT
{
public:
typedef typename w32_regex_traits<charT>::char_class_type char_class_type;
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 0x0400); // must be C1_DEFINED << 1
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 0x0800); // must be C1_DEFINED << 2
BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 0x1000); // must be C1_DEFINED << 3
BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 0x2000); // must be C1_DEFINED << 4
BOOST_STATIC_CONSTANT(char_class_type, mask_base = 0x3ff); // all the masks used by the CT_CTYPE1 group
static const char_class_type mask_word = 0x0400; // must be C1_DEFINED << 1
static const char_class_type mask_unicode = 0x0800; // must be C1_DEFINED << 2
static const char_class_type mask_horizontal = 0x1000; // must be C1_DEFINED << 3
static const char_class_type mask_vertical = 0x2000; // must be C1_DEFINED << 4
static const char_class_type mask_base = 0x3ff; // all the masks used by the CT_CTYPE1 group
typedef std::basic_string<charT> string_type;
typedef charT char_type;