Compare commits

...

34 Commits

Author SHA1 Message Date
e9645776f9 Merge branch 'develop' 2020-06-23 18:57:40 +01:00
9712546fae Merge pull request #105 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-06-17 19:15:37 +01:00
ea23777b48 Merge branch 'develop' 2020-04-28 17:41:58 +01:00
f712b89e6f Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero. 2020-04-25 20:13:16 -04:00
f307ef8353 Turn off testing wide character regexes when not appropriate. 2020-04-19 16:01:21 -04:00
31646aefa7 Always use __cdecl as the calling convention for the Embarcadero C++ clang-based compilers 2020-04-19 15:29:03 -04:00
cc09733d03 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 17:42:38 -04:00
d961318aa2 Merge pull request #101 from boostorg/git_issue_87
Fix recursive expressions where the recursion appears more than once.
2020-01-24 11:19:58 +00:00
afc4229234 Fix recursive expressions where the recursion appears more than once.
Fixes https://github.com/boostorg/regex/issues/87.
Also fix some more msvc warnings.
2020-01-23 19:24:33 +00:00
574fad65f0 Merge pull request #100 from boostorg/git_issue_80
Suppress msvc warnings.
2020-01-22 13:35:04 +00:00
bc160a58f0 Merge branch 'develop' into git_issue_80
Fixed Conflicts:
	include/boost/regex/v4/basic_regex_creator.hpp
	include/boost/regex/v4/basic_regex_parser.hpp
2020-01-21 12:57:09 +00:00
f64c22870f Fix exception specification and msvc warning push/pop. 2020-01-21 10:14:37 +00:00
70c3ffa89a Merge pull request #98 from boostorg/issue_75
Remove limit on the number of backrefs possible.
2020-01-21 10:13:40 +00:00
f80a3ab362 Merge pull request #99 from boostorg/feature/update-cmake
Fix CMake Travis failures
2020-01-21 10:12:56 +00:00
2cd947f7c4 Suppress msvc warnings.
Fixes: https://github.com/boostorg/regex/issues/80
2020-01-20 19:51:46 +00:00
deb9104ceb Fix gcc warning. 2020-01-19 17:19:54 +00:00
4bb4d392e4 Remove limit on the number of backrefs possible.
Changes named sub-expressions to use different hashing scheme: high order bit is now always set to clashes between hashes and indexes don't happen until 2^30 or 2^62 sub-expressions in 32 and 64 bit code respectively.
Changes bitmask of seen sub-expressions to use dynamic storage for sub-expression indexes above 64.
Adds tests for the above.
Fixes https://github.com/boostorg/regex/issues/75.
2020-01-19 11:28:36 +00:00
c21b52d87c Merge branch 'develop'
# Conflicts:
#	doc/html/boost_regex/background.html
#	doc/html/boost_regex/background/acknowledgements.html
#	doc/html/boost_regex/background/examples.html
#	doc/html/boost_regex/background/faq.html
#	doc/html/boost_regex/background/futher.html
#	doc/html/boost_regex/background/headers.html
#	doc/html/boost_regex/background/history.html
#	doc/html/boost_regex/background/locale.html
#	doc/html/boost_regex/background/performance.html
#	doc/html/boost_regex/background/performance/section_id1378460593.html
#	doc/html/boost_regex/background/performance/section_id1675827111.html
#	doc/html/boost_regex/background/performance/section_id3141719723.html
#	doc/html/boost_regex/background/performance/section_id3258595385.html
#	doc/html/boost_regex/background/performance/section_id3261825021.html
#	doc/html/boost_regex/background/performance/section_id3752650613.html
#	doc/html/boost_regex/background/performance/section_id4128344975.html
#	doc/html/boost_regex/background/performance/section_id4148872883.html
#	doc/html/boost_regex/background/redist.html
#	doc/html/boost_regex/background/standards.html
#	doc/html/boost_regex/background/thread_safety.html
#	doc/html/boost_regex/captures.html
#	doc/html/boost_regex/configuration.html
#	doc/html/boost_regex/configuration/algorithm.html
#	doc/html/boost_regex/configuration/compiler.html
#	doc/html/boost_regex/configuration/linkage.html
#	doc/html/boost_regex/configuration/locale.html
#	doc/html/boost_regex/configuration/tuning.html
#	doc/html/boost_regex/format.html
#	doc/html/boost_regex/format/boost_format_syntax.html
#	doc/html/boost_regex/format/perl_format.html
#	doc/html/boost_regex/format/sed_format.html
#	doc/html/boost_regex/install.html
#	doc/html/boost_regex/intro.html
#	doc/html/boost_regex/partial_matches.html
#	doc/html/boost_regex/ref.html
#	doc/html/boost_regex/ref/bad_expression.html
#	doc/html/boost_regex/ref/basic_regex.html
#	doc/html/boost_regex/ref/concepts.html
#	doc/html/boost_regex/ref/concepts/charT_concept.html
#	doc/html/boost_regex/ref/concepts/iterator_concepts.html
#	doc/html/boost_regex/ref/concepts/traits_concept.html
#	doc/html/boost_regex/ref/deprecated.html
#	doc/html/boost_regex/ref/deprecated/old_regex.html
#	doc/html/boost_regex/ref/deprecated/regex_format.html
#	doc/html/boost_regex/ref/deprecated/regex_grep.html
#	doc/html/boost_regex/ref/deprecated/regex_split.html
#	doc/html/boost_regex/ref/error_type.html
#	doc/html/boost_regex/ref/internals.html
#	doc/html/boost_regex/ref/internals/uni_iter.html
#	doc/html/boost_regex/ref/match_flag_type.html
#	doc/html/boost_regex/ref/match_results.html
#	doc/html/boost_regex/ref/non_std_strings.html
#	doc/html/boost_regex/ref/non_std_strings/icu.html
#	doc/html/boost_regex/ref/non_std_strings/icu/intro.html
#	doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html
#	doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html
#	doc/html/boost_regex/ref/non_std_strings/icu/unicode_types.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_intro.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_create.html
#	doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_regex_types.html
#	doc/html/boost_regex/ref/posix.html
#	doc/html/boost_regex/ref/regex_iterator.html
#	doc/html/boost_regex/ref/regex_match.html
#	doc/html/boost_regex/ref/regex_replace.html
#	doc/html/boost_regex/ref/regex_search.html
#	doc/html/boost_regex/ref/regex_token_iterator.html
#	doc/html/boost_regex/ref/regex_traits.html
#	doc/html/boost_regex/ref/sub_match.html
#	doc/html/boost_regex/ref/syntax_option_type.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_basic.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_extended.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_literal.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_overview.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_perl.html
#	doc/html/boost_regex/ref/syntax_option_type/syntax_option_type_synopsis.html
#	doc/html/boost_regex/syntax.html
#	doc/html/boost_regex/syntax/basic_extended.html
#	doc/html/boost_regex/syntax/basic_syntax.html
#	doc/html/boost_regex/syntax/character_classes.html
#	doc/html/boost_regex/syntax/character_classes/optional_char_class_names.html
#	doc/html/boost_regex/syntax/character_classes/std_char_classes.html
#	doc/html/boost_regex/syntax/collating_names.html
#	doc/html/boost_regex/syntax/collating_names/digraphs.html
#	doc/html/boost_regex/syntax/collating_names/named_unicode.html
#	doc/html/boost_regex/syntax/collating_names/posix_symbolic_names.html
#	doc/html/boost_regex/syntax/leftmost_longest_rule.html
#	doc/html/boost_regex/syntax/perl_syntax.html
#	doc/html/boost_regex/unicode.html
#	doc/html/index.html
2019-10-31 17:47:34 +00:00
18e7b8c463 Merge branch 'develop' 2019-02-24 09:17:34 +00:00
866d546fd0 Merge branch 'develop' 2018-10-22 19:07:00 +01:00
309eee3459 doc regen. 2018-09-15 09:00:20 +01:00
c653a0bf05 Merge branch 'develop' 2018-09-15 08:59:28 +01:00
a9fc8fb5de Merge pull request #50 from boostorg/develop
Merge Fuzz-bug fixes from develop
2017-11-24 17:25:41 +00:00
b3f73b4792 Merge pull request #48 from boostorg/develop
Merge de-fuzz fixes from develop.
2017-10-29 17:03:03 +00:00
5bc2a4a301 Merge pull request #39 from boostorg/develop
Merge develop to master
2017-10-09 18:27:25 +01:00
8191d58266 Remove corpus files from master - we don't need them here! 2017-03-03 09:18:29 +00:00
f0b577a82c Merge branch 'develop' 2017-03-02 18:33:14 +00:00
ed556985d7 Merge branch 'develop' 2016-11-03 20:05:53 +01:00
bf7d64a7ef Add, and update, documentation build targets. 2016-10-10 11:39:53 -05:00
6f02c1a388 Merge branch 'develop' 2016-08-22 12:50:59 +01:00
dec7b5028d Merge branch 'develop' 2016-08-10 18:34:37 +01:00
dd20ac2669 Merge branch 'develop'
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2016-04-01 18:35:47 +01:00
d84bab7c4d Merge branch 'develop' 2016-02-15 19:32:53 +00:00
9034bd9c02 Merge branch 'develop' 2015-10-20 13:43:25 +01:00
3908 changed files with 436 additions and 6866 deletions

View File

@ -17,7 +17,7 @@
* using a C++ Builder closure as a callback.
*/
#ifdef __BORLANDC__
#if defined(__BORLANDC__) && !defined(__clang__)
#include <boost/regex.hpp>
#include <string>
@ -140,7 +140,7 @@ int main(int argc, const char** argv)
return 0;
}
#else // __BORLANDC__
#else // __BORLANDC__ && !defined(__clang__)
int main()
{

View File

@ -49,7 +49,7 @@ int process_ftp(const char* response, std::string* msg)
return -1;
}
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550))
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550))
//
// problem with std::getline under MSVC6sp3
istream& getline(istream& is, std::string& s)

View File

@ -30,7 +30,7 @@ unsigned tokenise(std::list<std::string>& l, std::string& s)
using namespace std;
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550))
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550))
//
// problem with std::getline under MSVC6sp3
istream& getline(istream& is, std::string& s)

View File

@ -23,7 +23,7 @@
using namespace std;
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550))
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550))
//
// problem with std::getline under MSVC6sp3
istream& getline(istream& is, std::string& s)

View File

@ -89,7 +89,7 @@ public:
};
namespace boost{
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) || defined(__SGI_STL_PORT)
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) || defined(__SGI_STL_PORT)
//
// problem with std::getline under MSVC6sp3
// and C++ Builder 5.5, is this really that hard?
@ -367,16 +367,9 @@ int main(int argc, char**argv)
}
#if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(UNDER_CE)
#if !defined(BOOST_EMBTC)
#pragma comment(lib, "user32.lib")
#else
#pragma comment(lib, "user32.a")
#endif
#endif

View File

@ -22,7 +22,7 @@
* Borland C++ Fix/error check
* this has to go *before* we include any std lib headers:
*/
#if defined(__BORLANDC__)
#if defined(__BORLANDC__) && !defined(__clang__)
# include <boost/regex/config/borland.hpp>
#endif
#include <boost/version.hpp>
@ -279,9 +279,14 @@
#endif
#if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)
#if defined(__clang__)
# define BOOST_REGEX_CALL __cdecl
# define BOOST_REGEX_CCALL __cdecl
#else
# define BOOST_REGEX_CALL __fastcall
# define BOOST_REGEX_CCALL __stdcall
#endif
#endif
#ifndef BOOST_REGEX_CALL
# define BOOST_REGEX_CALL
@ -378,7 +383,7 @@ if(0 == (x))\
#if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3)
# if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
&& !defined(__GNUC__) \
&& !(defined(__GNUC__) || defined(__BORLANDC__) && defined(__clang__)) \
&& !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \
&& !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
# define BOOST_REGEX_HAS_MS_STACK_GUARD

View File

@ -17,7 +17,7 @@
*/
#if defined(__BORLANDC__)
#if defined(__BORLANDC__) && !defined(__clang__)
# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
// problems with std::basic_string and dll RTL:
# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE)

View File

@ -43,13 +43,16 @@ namespace boost{
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable : 4275)
#if BOOST_MSVC >= 1800
#pragma warning(disable : 26812)
#endif
#endif
class BOOST_REGEX_DECL regex_error : public std::runtime_error
{
public:
explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0);
explicit regex_error(regex_constants::error_type err);
~regex_error() throw();
~regex_error() BOOST_NOEXCEPT_OR_NOTHROW;
regex_constants::error_type code()const
{ return m_error_code; }
std::ptrdiff_t position()const

View File

@ -57,6 +57,10 @@ private:
friend struct data;
};
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4702)
#endif
template <class Key, class Object>
boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type l_max_cache_size)
{
@ -80,6 +84,9 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
return do_get(k, l_max_cache_size);
#endif
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
template <class Key, class Object>
boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type l_max_cache_size)

View File

@ -70,13 +70,14 @@ void bubble_down_one(I first, I last)
}
}
static const int hash_value_mask = 1 << (std::numeric_limits<int>::digits - 1);
template <class Iterator>
inline int hash_value_from_capture_name(Iterator i, Iterator j)
{
std::size_t r = boost::hash_range(i, j);
r %= ((std::numeric_limits<int>::max)() - 10001);
r += 10000;
return static_cast<int>(r);
r %= ((std::numeric_limits<int>::max)());
return static_cast<int>(r) | hash_value_mask;
}
class named_subexpressions
@ -170,9 +171,19 @@ struct regex_data : public named_subexpressions
regex_data(const ::boost::shared_ptr<
::boost::regex_traits_wrapper<traits> >& t)
: m_ptraits(t), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
: m_ptraits(t), m_flags(0), m_status(0), m_expression(0), m_expression_len(0),
m_mark_count(0), m_first_state(0), m_restart_type(0),
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900))
m_startmap{ 0 },
#endif
m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {}
regex_data()
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_flags(0), m_status(0), m_expression(0), m_expression_len(0),
m_mark_count(0), m_first_state(0), m_restart_type(0),
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900))
m_startmap{ 0 },
#endif
m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {}
::boost::shared_ptr<
::boost::regex_traits_wrapper<traits>

View File

@ -20,6 +20,8 @@
#ifndef BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP
#define BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP
#include <boost/regex/v4/indexed_bit_flag.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
@ -239,7 +241,7 @@ protected:
bool m_icase; // true for case insensitive matches
unsigned m_repeater_id; // the state_id of the next repeater
bool m_has_backrefs; // true if there are actually any backrefs
unsigned m_backrefs; // bitmask of permitted backrefs
indexed_bit_flag m_backrefs; // bitmask of permitted backrefs
boost::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for;
bool m_has_recursions; // set when we have recursive expresisons to fixup
std::vector<unsigned char> m_recursion_checks; // notes which recursions we've followed while analysing this expression
@ -267,7 +269,8 @@ private:
template <class charT, class traits>
basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits>* data)
: m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false)
: m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_icase(false), m_repeater_id(0),
m_has_backrefs(false), m_bad_repeats(0), m_has_recursions(false), m_word_mask(0), m_mask_space(0), m_lower_mask(0), m_upper_mask(0), m_alpha_mask(0)
{
m_pdata->m_data.clear();
m_pdata->m_status = ::boost::regex_constants::error_ok;
@ -591,7 +594,7 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set(
return 0;
}
// everything in range matches:
std::memset(result->_map + static_cast<unsigned char>(c1), true, 1 + static_cast<unsigned char>(c2) - static_cast<unsigned char>(c1));
std::memset(result->_map + static_cast<unsigned char>(c1), true, static_cast<unsigned char>(1u) + static_cast<unsigned char>(static_cast<unsigned char>(c2) - static_cast<unsigned char>(c1)));
}
}
//
@ -763,7 +766,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
if(idx < 0)
{
idx = -idx-1;
if(idx >= 10000)
if(idx >= hash_value_mask)
{
idx = m_pdata->get_id(idx);
if(idx <= 0)
@ -795,7 +798,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
bool ok = false;
re_syntax_base* p = base;
std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
if(idx > 10000)
if(idx >= hash_value_mask)
{
//
// There may be more than one capture group with this hash, just do what Perl
@ -1067,9 +1070,21 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
return -1;
}
struct recursion_saver
{
std::vector<unsigned char> saved_state;
std::vector<unsigned char>* state;
recursion_saver(std::vector<unsigned char>* p) : saved_state(*p), state(p) {}
~recursion_saver()
{
state->swap(saved_state);
}
};
template <class charT, class traits>
void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state, unsigned char* l_map, unsigned int* pnull, unsigned char mask)
{
recursion_saver saved_recursions(&m_recursion_checks);
int not_last_jump = 1;
re_syntax_base* recursion_start = 0;
int recursion_sub = 0;
@ -1512,6 +1527,10 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
state = state->next.p;
continue;
}
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:6011)
#endif
if((static_cast<re_brace*>(state)->index == -1)
|| (static_cast<re_brace*>(state)->index == -2))
{
@ -1519,6 +1538,9 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
state = static_cast<const re_jump*>(state->next.p)->alt.p->next.p;
continue;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
if(static_cast<re_brace*>(state)->index == -3)
{
// Have to skip the leading jump state:

View File

@ -22,6 +22,9 @@
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
#if BOOST_MSVC >= 1800
#pragma warning(disable: 26812)
#endif
#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
@ -124,7 +127,8 @@ private:
template <class charT, class traits>
basic_regex_parser<charT, traits>::basic_regex_parser(regex_data<charT, traits>* data)
: basic_regex_creator<charT, traits>(data), m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0)
: basic_regex_creator<charT, traits>(data), m_parser_proc(), m_base(0), m_end(0), m_position(0),
m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0)
{
}
@ -193,7 +197,7 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2,
if(this->m_pdata->m_status)
return;
// fill in our sub-expression count:
this->m_pdata->m_mark_count = 1 + m_mark_count;
this->m_pdata->m_mark_count = 1u + (std::size_t)m_mark_count;
this->finalize(p1, p2);
}
@ -321,6 +325,12 @@ bool basic_regex_parser<charT, traits>::parse_basic()
return true;
}
#ifdef BOOST_MSVC
# pragma warning(push)
#if BOOST_MSVC >= 1800
#pragma warning(disable:26812)
#endif
#endif
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_extended()
{
@ -409,6 +419,9 @@ bool basic_regex_parser<charT, traits>::parse_extended()
return result;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
@ -545,8 +558,8 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
//
// allow backrefs to this mark:
//
if((markid > 0) && (markid < sizeof(unsigned) * CHAR_BIT))
this->m_backrefs |= 1u << (markid - 1);
if(markid > 0)
this->m_backrefs.set(markid);
return true;
}
@ -911,8 +924,8 @@ escape_type_class_jump:
pc = m_position;
}
if(negative)
i = 1 + m_mark_count - i;
if(((i > 0) && (i < std::numeric_limits<unsigned>::digits) && (i - 1 < static_cast<boost::intmax_t>(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_pdata->get_id(i)-1 < static_cast<boost::intmax_t>(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1)))))
i = 1 + (static_cast<boost::intmax_t>(m_mark_count) - i);
if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test(i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id(i)))))
{
m_position = pc;
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));
@ -1944,7 +1957,7 @@ bool basic_regex_parser<charT, traits>::parse_backref()
charT c = unescape_character();
this->append_literal(c);
}
else if((i > 0) && (this->m_backrefs & (1u << (i-1))))
else if((i > 0) && (this->m_backrefs.test(i)))
{
m_position = pc;
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));
@ -2132,7 +2145,7 @@ insert_recursion:
// Oops not a relative recursion at all, but a (?-imsx) group:
goto option_group_jump;
}
v = m_mark_count + 1 - v;
v = static_cast<boost::intmax_t>(m_mark_count) + 1 - v;
if(v <= 0)
{
// Rewind to start of (? sequence:
@ -2710,7 +2723,7 @@ option_group_jump:
{
#ifndef BOOST_NO_STD_DISTANCE
if(this->flags() & regbase::save_subexpression_location)
this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position) - 1;
this->m_pdata->m_subs.at((std::size_t)markid - 1).second = std::distance(m_base, m_position) - 1;
#else
if(this->flags() & regbase::save_subexpression_location)
this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base) - 1;
@ -2718,8 +2731,7 @@ option_group_jump:
//
// allow backrefs to this mark:
//
if(markid < (int)(sizeof(unsigned) * CHAR_BIT))
this->m_backrefs |= 1u << (markid - 1);
this->m_backrefs.set(markid);
}
return true;
}
@ -2747,6 +2759,12 @@ bool basic_regex_parser<charT, traits>::match_verb(const char* verb)
return true;
}
#ifdef BOOST_MSVC
# pragma warning(push)
#if BOOST_MSVC >= 1800
#pragma warning(disable:26812)
#endif
#endif
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::parse_perl_verb()
{
@ -2915,6 +2933,9 @@ bool basic_regex_parser<charT, traits>::parse_perl_verb()
fail(regex_constants::error_perl_extension, m_position - m_base);
return false;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::add_emacs_code(bool negate)

View File

@ -174,7 +174,7 @@ template <class charT>
struct cpp_regex_traits_base
{
cpp_regex_traits_base(const std::locale& l)
{ imbue(l); }
{ (void)imbue(l); }
std::locale imbue(const std::locale& l);
std::locale m_locale;
@ -616,7 +616,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
// std::collate<wchar_t>::transform returns a different string!
// So as a workaround, we'll truncate the string at the first NULL
// which _seems_ to work....
#if BOOST_WORKAROUND(__BORLANDC__, < 0x580)
#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x580)
result.erase(result.find(charT(0)));
#else
//
@ -669,7 +669,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
return pos->second;
}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
std::string name(p1, p2);
#else
std::string name;
@ -679,7 +679,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
#endif
name = lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
if(name.size())
return string_type(name.begin(), name.end());
#else

View File

@ -231,7 +231,7 @@ struct pred4;
} /* namespace BOOST_REGEX_DETAIL_NS */
#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32)
#if (defined(BOOST_MSVC) || defined(BOOST_BORLANDC)) && !defined(BOOST_DISABLE_WIN32)
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
typedef bool (__cdecl *FindFilesCallback)(const char* file);

View File

@ -270,6 +270,8 @@ public:
return *this;
}
#if !defined(BOOST_EMBTC)
friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j)
{
return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset);
@ -308,8 +310,64 @@ public:
{
return i.position() - j.position();
}
#else
friend bool operator==(const mapfile_iterator& i, const mapfile_iterator& j);
friend bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j);
friend bool operator<(const mapfile_iterator& i, const mapfile_iterator& j);
friend bool operator>(const mapfile_iterator& i, const mapfile_iterator& j);
friend bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j);
friend bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j);
friend mapfile_iterator operator + (const mapfile_iterator& i, long off);
friend mapfile_iterator operator + (long off, const mapfile_iterator& i);
friend mapfile_iterator operator - (const mapfile_iterator& i, long off);
friend long operator - (const mapfile_iterator& i, const mapfile_iterator& j);
#endif
};
#if defined(BOOST_EMBTC)
inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j)
{
return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset);
}
inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j)
{
return !(i == j);
}
inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() < j.position();
}
inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() > j.position();
}
inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() <= j.position();
}
inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() >= j.position();
}
mapfile_iterator operator + (long off, const mapfile_iterator& i)
{
mapfile_iterator tmp(i);
return tmp += off;
}
inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() - j.position();
}
#endif
#endif
// _fi_sep determines the directory separator, either '\\' or '/'
@ -351,6 +409,8 @@ public:
file_iterator operator++(int);
const char* operator*() { return path(); }
#if !defined(BOOST_EMBTC)
friend inline bool operator == (const file_iterator& f1, const file_iterator& f2)
{
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
@ -361,8 +421,29 @@ public:
return !(f1 == f2);
}
#else
friend bool operator == (const file_iterator& f1, const file_iterator& f2);
friend bool operator != (const file_iterator& f1, const file_iterator& f2);
#endif
};
#if defined(BOOST_EMBTC)
inline bool operator == (const file_iterator& f1, const file_iterator& f2)
{
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
}
inline bool operator != (const file_iterator& f1, const file_iterator& f2)
{
return !(f1 == f2);
}
#endif
// dwa 9/13/00 - suppress unused parameter warning
inline bool operator < (const file_iterator&, const file_iterator&)
{
@ -401,6 +482,8 @@ public:
static const char* separator() { return _fi_sep; }
#if !defined(BOOST_EMBTC)
friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2)
{
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
@ -412,8 +495,30 @@ public:
return !(f1 == f2);
}
#else
friend bool operator == (const directory_iterator& f1, const directory_iterator& f2);
friend bool operator != (const directory_iterator& f1, const directory_iterator& f2);
#endif
};
#if defined(BOOST_EMBTC)
inline bool operator == (const directory_iterator& f1, const directory_iterator& f2)
{
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
}
inline bool operator != (const directory_iterator& f1, const directory_iterator& f2)
{
return !(f1 == f2);
}
#endif
inline bool operator < (const directory_iterator&, const directory_iterator&)
{
return false;

View File

@ -0,0 +1,54 @@
/*
*
* Copyright (c) 2020
* John Maddock
*
* Use, modification and distribution are subject to 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)
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE basic_regex_parser.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Declares template class basic_regex_parser.
*/
#include <boost/regex/config.hpp>
#include <set>
#ifndef BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
#define BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
namespace boost{
namespace BOOST_REGEX_DETAIL_NS{
class indexed_bit_flag
{
boost::uint64_t low_mask;
std::set<std::size_t> mask_set;
public:
indexed_bit_flag() : low_mask(0) {}
void set(std::size_t i)
{
if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
low_mask |= static_cast<boost::uint64_t>(1u) << i;
else
mask_set.insert(i);
}
bool test(std::size_t i)
{
if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
return low_mask & static_cast<boost::uint64_t>(1u) << i ? true : false;
else
return mask_set.find(i) != mask_set.end();
}
};
} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#endif

View File

@ -41,7 +41,7 @@ namespace boost{
// what follows is compiler specific:
//
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x600)
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX

View File

@ -28,6 +28,13 @@ namespace boost{
namespace regex_constants{
#endif
#ifdef BOOST_MSVC
#pragma warning(push)
#if BOOST_MSVC >= 1800
#pragma warning(disable : 26812)
#endif
#endif
typedef enum _match_flags
{
match_default = 0,
@ -82,7 +89,7 @@ typedef enum _match_flags
} match_flags;
#if defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER <= 1310))
#if defined(BOOST_BORLANDC) || (defined(_MSC_VER) && (_MSC_VER <= 1310))
typedef unsigned long match_flag_type;
#else
typedef match_flags match_flag_type;
@ -143,6 +150,11 @@ using regex_constants::format_no_copy;
using regex_constants::format_first_only;
/*using regex_constants::format_is_if;*/
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
} /* namespace boost */
#endif /* __cplusplus */
#endif /* include guard */

View File

@ -95,7 +95,7 @@ public:
// See https://svn.boost.org/trac/boost/ticket/3632.
//
match_results(const match_results& m)
: m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular)
: m_subs(m.m_subs), m_base(), m_null(), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular)
{
if(!m_is_singular)
{

View File

@ -27,6 +27,13 @@
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable : 4251)
#if BOOST_MSVC < 1700
# pragma warning(disable : 4231)
#endif
# if BOOST_MSVC < 1600
# pragma warning(disable : 4660)
# endif
#if BOOST_MSVC < 1910
#pragma warning(disable:4800)
#endif
@ -341,6 +348,12 @@ enum saved_state_type
saved_state_count = 14
};
#ifdef BOOST_MSVC
# pragma warning(push)
#if BOOST_MSVC >= 1800
#pragma warning(disable:26495)
#endif
#endif
template <class Results>
struct recursion_info
{
@ -352,16 +365,8 @@ struct recursion_info
repeater_count<iterator>* repeater_stack;
iterator location_of_start;
};
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable : 4251)
#if BOOST_MSVC < 1700
# pragma warning(disable : 4231)
#endif
# if BOOST_MSVC < 1600
# pragma warning(disable : 4660)
# endif
# pragma warning(pop)
#endif
template <class BidiIterator, class Allocator, class traits>
@ -578,6 +583,12 @@ private:
unsigned m_recursions;
#endif
#ifdef BOOST_MSVC
# pragma warning(push)
#if BOOST_MSVC >= 1800
#pragma warning(disable:26495)
#endif
#endif
// these operations aren't allowed, so are declared private,
// bodies are provided to keep explicit-instantiation requests happy:
perl_matcher& operator=(const perl_matcher&)
@ -586,14 +597,17 @@ private:
}
perl_matcher(const perl_matcher& that)
: m_result(that.m_result), re(that.re), traits_inst(that.traits_inst), rep_obj(0) {}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
} // namespace BOOST_REGEX_DETAIL_NS
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
@ -607,10 +621,6 @@ private:
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
//
// include the implementation of perl_matcher:
//

View File

@ -23,6 +23,9 @@
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4103)
#if BOOST_MSVC >= 1800
#pragma warning(disable: 26812)
#endif
#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
@ -31,7 +34,7 @@
#pragma warning(pop)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
# pragma option push -w-8008 -w-8066
#endif
#ifdef BOOST_MSVC
@ -44,7 +47,11 @@
namespace boost{
namespace BOOST_REGEX_DETAIL_NS{
template <class BidiIterator, class Allocator, class traits>
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
template <class BidiIterator, class Allocator, class traits>
void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_regex<char_type, traits>& e, match_flag_type f)
{
typedef typename regex_iterator_traits<BidiIterator>::iterator_category category;
@ -94,6 +101,9 @@ void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_r
if(e.get_data().m_disable_match_any)
m_match_flags &= regex_constants::match_not_any;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
template <class BidiIterator, class Allocator, class traits>
void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(std::random_access_iterator_tag*)
@ -609,7 +619,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_backref()
// or PCRE.
//
int index = static_cast<const re_brace*>(pstate)->index;
if(index >= 10000)
if(index >= hash_value_mask)
{
named_subexpressions::range_type r = re.get_data().equal_range(index);
BOOST_ASSERT(r.first != r.second);
@ -758,7 +768,7 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
{
// Have we matched subexpression "index"?
// Check if index is a hash value:
if(index >= 10000)
if(index >= hash_value_mask)
{
named_subexpressions::range_type r = re.get_data().equal_range(index);
while(r.first != r.second)
@ -782,7 +792,7 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
// Have we recursed into subexpression "index"?
// If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
int idx = -(index+1);
if(idx >= 10000)
if(idx >= hash_value_mask)
{
named_subexpressions::range_type r = re.get_data().equal_range(idx);
int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx;
@ -1002,7 +1012,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_lit()
# pragma warning(pop)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
# pragma option pop
#endif
#ifdef BOOST_MSVC

View File

@ -600,7 +600,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
#pragma warning(push)
#pragma warning(disable:4127 4244)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
@ -691,7 +691,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
}
}
return false;
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC
@ -790,7 +790,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
@ -850,7 +850,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip);
}
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC
@ -865,7 +865,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
@ -924,7 +924,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip);
}
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC
@ -939,7 +939,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
typedef typename traits::char_class_type m_type;
@ -999,7 +999,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
pstate = rep->alt.p;
return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip);
}
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC

View File

@ -548,7 +548,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
#pragma warning(disable:4127)
#pragma warning(disable:4267)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
@ -637,7 +637,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
return false;
}
}while(true);
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC
@ -652,7 +652,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
@ -732,7 +732,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
return false;
}
}while(true);
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC
@ -747,7 +747,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
#pragma warning(push)
#pragma warning(disable:4127)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option push -w-8008 -w-8066 -w-8004
#endif
typedef typename traits::char_class_type char_class_type;
@ -828,7 +828,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
return false;
}
}while(true);
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option pop
#endif
#ifdef BOOST_MSVC

View File

@ -90,6 +90,10 @@ struct trivial_format_traits
}
};
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
template <class OutputIterator, class Results, class traits, class ForwardIter>
class basic_regex_formatter
{
@ -203,6 +207,9 @@ private:
basic_regex_formatter(const basic_regex_formatter&);
basic_regex_formatter& operator=(const basic_regex_formatter&);
};
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
template <class OutputIterator, class Results, class traits, class ForwardIter>
OutputIterator basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format(ForwardIter p1, ForwardIter p2, match_flag_type f)

View File

@ -21,7 +21,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/detail/workaround.hpp>
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
//
// Borland C++ Builder 6, and Visual C++ 6,
@ -67,16 +67,16 @@ class regex_token_iterator_implementation
public:
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, int sub, match_flag_type f)
: end(last), re(*p), flags(f){ subs.push_back(sub); }
: end(last), re(*p), flags(f), N(0){ subs.push_back(sub); }
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector<int>& v, match_flag_type f)
: end(last), re(*p), flags(f), subs(v){}
: end(last), re(*p), flags(f), N(0), subs(v){}
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f)
: end(last), re(*p), flags(f)
: end(last), re(*p), flags(f), N(0)
{
// assert that T really is an array:
BOOST_STATIC_ASSERT(::boost::is_array<T>::value);
@ -89,7 +89,7 @@ public:
#else
template <std::size_t CN>
regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f)
: end(last), re(*p), flags(f)
: end(last), re(*p), flags(f), N(0)
{
for(std::size_t i = 0; i < CN; ++i)
{
@ -196,7 +196,7 @@ public:
pdata.reset();
}
#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700)
template <class T>

View File

@ -39,7 +39,7 @@
# include <boost/regex/v4/cpp_regex_traits.hpp>
# endif
#endif
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
# ifndef BOOST_C_REGEX_TRAITS_HPP_INCLUDED
# include <boost/regex/v4/c_regex_traits.hpp>
# endif

View File

@ -50,7 +50,7 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
sub_match() : std::pair<BidiIterator, BidiIterator>(), matched(false) {}
sub_match(BidiIterator i) : std::pair<BidiIterator, BidiIterator>(i, i), matched(false) {}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)\
&& !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
template <class T, class A>
operator std::basic_string<value_type, T, A> ()const

View File

@ -19,7 +19,7 @@
#ifndef BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP
#define BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
//
// Borland C++ Builder 6, and Visual C++ 6,

View File

@ -403,7 +403,7 @@ typename w32_regex_traits_implementation<charT>::string_type
return pos->second;
}
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
std::string name(p1, p2);
#else
std::string name;
@ -413,7 +413,7 @@ typename w32_regex_traits_implementation<charT>::string_type
#endif
name = lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
if(name.size())
return string_type(name.begin(), name.end());
#else
@ -546,7 +546,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
if(pos != m_custom_class_names.end())
return pos->second;
}
std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
std::size_t state_id = 1u + (std::size_t)BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(state_id < sizeof(masks) / sizeof(masks[0]))
return masks[state_id];
return masks[0];

View File

@ -23,7 +23,7 @@
#include <boost/detail/workaround.hpp>
#include "internals.hpp"
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
#include <boost/regex/v4/c_regex_traits.hpp>
#include <boost/regex/v4/primary_transform.hpp>
@ -157,7 +157,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo
s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
BOOST_ASSERT(std::size_t(idx) + 1u < sizeof(masks) / sizeof(masks[0]));
return masks[idx+1];
}

View File

@ -37,8 +37,8 @@ typedef boost::match_flag_type match_flag_type;
namespace boost{
#ifdef __BORLANDC__
#if __BORLANDC__ < 0x530
#ifdef BOOST_BORLANDC
#if BOOST_BORLANDC < 0x530
//
// we need to instantiate the vector classes we use
// since declaring a reference to type doesn't seem to
@ -70,6 +70,10 @@ inline std::string to_string(const char* i, const char* j)
}
namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
class RegExData
{
public:
@ -103,6 +107,9 @@ public:
#endif
strings(), positions() {}
};
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
void RegExData::update()
{
@ -583,7 +590,7 @@ const std::size_t RegEx::npos = ~static_cast<std::size_t>(0);
} // namespace boost
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) && (__BORLANDC__ <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE)
#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x550) && (BOOST_BORLANDC <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE)
//
// this is an ugly hack to work around an ugly problem:
// by default this file will produce unresolved externals during

View File

@ -61,7 +61,7 @@ namespace boost{
namespace BOOST_REGEX_DETAIL_NS{
// start with the operating system specific stuff:
#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
#if (defined(BOOST_BORLANDC) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
// platform is DOS or Windows
// directories are separated with '\\'
@ -112,16 +112,21 @@ void mapfile::open(const char* file)
std::runtime_error err("Unable to create file mapping.");
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if(_first == 0)
else
{
CloseHandle(hmap);
CloseHandle(hfile);
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if (_first == 0)
{
CloseHandle(hmap);
CloseHandle(hfile);
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
else
_last = _first + GetFileSize(hfile, 0);
}
_last = _first + GetFileSize(hfile, 0);
}
else
{

View File

@ -23,7 +23,7 @@
#if !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)
#define BOOST_REGEX_NARROW_INSTANTIATE
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hrdstop
#endif

View File

@ -66,6 +66,10 @@ const char* names[] = {
typedef boost::basic_regex<char, c_regex_traits<char> > c_regex_type;
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char* ptr, int f)
{
#ifndef BOOST_NO_EXCEPTIONS
@ -140,6 +144,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char
return result;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, regsize_t buf_size)
{

View File

@ -72,7 +72,7 @@ regex_error::regex_error(regex_constants::error_type err)
{
}
regex_error::~regex_error() throw()
regex_error::~regex_error() BOOST_NOEXCEPT_OR_NOTHROW
{
}

View File

@ -71,7 +71,7 @@ template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>(
#include <boost/regex/config.hpp>
#include <boost/detail/workaround.hpp>
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
#include <boost/regex/v4/c_regex_traits.hpp>
#ifndef BOOST_NO_WREGEX
@ -224,7 +224,7 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::l
{
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
std::string name(p1, p2);
#else
std::string name;
@ -235,7 +235,7 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::l
name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
if(name.size())
return string_type(name.begin(), name.end());
#else
@ -257,7 +257,7 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::l
int BOOST_REGEX_CALL c_regex_traits<wchar_t>::value(wchar_t c, int radix)
{
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
// workaround for broken wcstol:
if((std::iswxdigit)(c) == 0)
return -1;
@ -310,5 +310,5 @@ int BOOST_REGEX_CALL c_regex_traits<unsigned short>::value(unsigned short c, int
#endif // BOOST_NO_WREGEX
#endif // __BORLANDC__
#endif // BOOST_BORLANDC

View File

@ -76,6 +76,10 @@ const wchar_t* wnames[] = {
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > wc_regex_type;
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f)
{
#ifndef BOOST_NO_EXCEPTIONS
@ -150,6 +154,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
return result;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, regsize_t buf_size)
{

View File

@ -23,7 +23,7 @@
#if !defined(BOOST_NO_WREGEX) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)
#define BOOST_REGEX_WIDE_INSTANTIATE
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hrdstop
#endif

View File

@ -68,6 +68,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected
}
}
}
#if !defined(BOOST_NO_WREGEX)
std::wstring wre(regx.begin(), regx.end());
std::wstring wtext(text.begin(), text.end());
@ -89,6 +91,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected
}
}
}
#endif
#ifdef BOOST_HAS_ICU
boost::u32regex ure = boost::make_u32regex(regx);

View File

@ -230,7 +230,7 @@ int cpp_main(int /*argc*/, char * /*argv*/[])
print_cpp_info(wchar_t(0), "wchar_t");
#endif
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
boost::c_regex_traits<char> a;
print_sort_syntax(a, "boost::c_regex_traits<char>");
#ifndef BOOST_NO_WREGEX

View File

@ -15,7 +15,7 @@
// this lets us compile at warning level 4 without seeing concept-check related warnings
# pragma warning(disable:4100)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option -w-8019 -w-8004 -w-8008
#endif
#ifdef BOOST_INTEL
@ -53,7 +53,7 @@ int main()
>();
#endif
#endif
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
boost::function_requires<
boost::BoostRegexConcept<
boost::basic_regex<char, boost::c_regex_traits<char> >

View File

@ -21,7 +21,7 @@
// this lets us compile at warning level 4 without seeing concept-check related warnings
# pragma warning(disable:4100)
#endif
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma option -w-8019 -w-8004 -w-8008
#endif

View File

@ -1 +0,0 @@
Z(((((((a+)+)+)+)+)+)+)+|Y(((((((a+)+)+)+)+)+)+)+|X(((((((a+)+)+)+)+)+)+)+|W(((((((a+)+)+)+)+)+)+)+|V(((((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+;+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV(((((((a+)+)+)+)+)+)+)+|(a+)+b)

View File

@ -1 +0,0 @@
Z(((((((a+)+)+)+)+<2B><><EFBFBD><EFBFBD>)+|Y(((((((a+)+)+)+)+)++)+)|X(((((((a+)+)+)+)+)+)+)+|W((<28><>(((a+)+)+)+)+)+)+)+;|V((()++)+)+|CW(((((((a+)+)+)+((((a+)+)+)+)+)+)+)+|CZ(((((((a+)+)+)+)+)+)+)+|CY(((((((a+)+)+)+)+)+)+)+|CX(((((((a+)+)+)+)+)+)+)+|CW(((((((a+)+)+)+)+)+)+)+|CV,((((((a+)+)+)+)+)+)+)+|(a+)+bc

Some files were not shown because too many files have changed in this diff Show More