mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 06:12:10 +02:00
Remove dead files.
Strip tabs from files. Fix MSVC-specific workaround that doesn't work on Win64. [SVN r30002]
This commit is contained in:
@ -1,281 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2001
|
|
||||||
* 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)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOOST_DETAIL_ALLOCATOR_HPP
|
|
||||||
#define BOOST_DETAIL_ALLOCATOR_HPP
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <new>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/assert.hpp>
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
|
||||||
namespace std{
|
|
||||||
using ::ptrdiff_t;
|
|
||||||
using ::size_t;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// see if we have SGI alloc class:
|
|
||||||
#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
|
|
||||||
# define BOOST_HAVE_SGI_ALLOCATOR
|
|
||||||
# include <memory>
|
|
||||||
# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
typedef std::__sgi_alloc alloc_type;
|
|
||||||
}}
|
|
||||||
# else
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
typedef std::alloc alloc_type;
|
|
||||||
}}
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void allocator_construct(T* p, const T& t)
|
|
||||||
{ new (p) T(t); }
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
void allocator_destroy(T* p)
|
|
||||||
{
|
|
||||||
(void)p; // warning suppression
|
|
||||||
p->~T();
|
|
||||||
}
|
|
||||||
|
|
||||||
} }
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_STD_ALLOCATOR)
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator< T >
|
|
||||||
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
|
|
||||||
template <class T, class A>
|
|
||||||
struct rebind_allocator
|
|
||||||
{
|
|
||||||
typedef typename A::template rebind<T> binder;
|
|
||||||
typedef typename binder::other type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__SUNPRO_CC)
|
|
||||||
|
|
||||||
// no std::allocator, but the compiler supports the necessary syntax,
|
|
||||||
// write our own allocator instead:
|
|
||||||
|
|
||||||
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator< T >
|
|
||||||
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class allocator
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef T value_type;
|
|
||||||
typedef value_type * pointer;
|
|
||||||
typedef const T* const_pointer;
|
|
||||||
typedef T& reference;
|
|
||||||
typedef const T& const_reference;
|
|
||||||
typedef std::size_t size_type;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
|
|
||||||
template <class U>
|
|
||||||
struct rebind
|
|
||||||
{
|
|
||||||
typedef allocator<U> other;
|
|
||||||
};
|
|
||||||
|
|
||||||
allocator(){}
|
|
||||||
|
|
||||||
template <class U>
|
|
||||||
allocator(const allocator<U>&){}
|
|
||||||
|
|
||||||
allocator(const allocator&){}
|
|
||||||
|
|
||||||
template <class U>
|
|
||||||
allocator& operator=(const allocator<U>&)
|
|
||||||
{ return *this; }
|
|
||||||
|
|
||||||
~allocator(){}
|
|
||||||
|
|
||||||
pointer address(reference x) { return &x; }
|
|
||||||
|
|
||||||
const_pointer address(const_reference x) const { return &x; }
|
|
||||||
|
|
||||||
pointer allocate(size_type n, const void* = 0)
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
|
||||||
return n != 0 ?
|
|
||||||
reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
|
|
||||||
: 0;
|
|
||||||
#else
|
|
||||||
return n != 0 ?
|
|
||||||
reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
|
|
||||||
: 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
|
||||||
BOOST_ASSERT( (p == 0) == (n == 0) );
|
|
||||||
if (p != 0)
|
|
||||||
alloc_type::deallocate((void*)p, n);
|
|
||||||
#else
|
|
||||||
BOOST_ASSERT( (p == 0) == (n == 0) );
|
|
||||||
if (p != 0)
|
|
||||||
::operator delete((void*)p);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
size_type max_size() const
|
|
||||||
{ return size_t(-1) / sizeof(value_type); }
|
|
||||||
|
|
||||||
void construct(pointer p, const T& val) const
|
|
||||||
{ allocator_construct(p, val); }
|
|
||||||
|
|
||||||
void destroy(pointer p) const
|
|
||||||
{ allocator_destroy(p); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class A>
|
|
||||||
struct rebind_allocator
|
|
||||||
{
|
|
||||||
typedef typename A::template rebind<T> binder;
|
|
||||||
typedef typename binder::other type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// no std::allocator, use workaround version instead,
|
|
||||||
// each allocator class must derive from a base class
|
|
||||||
// that allocates blocks of bytes:
|
|
||||||
|
|
||||||
#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
|
|
||||||
|
|
||||||
namespace boost{ namespace detail{
|
|
||||||
|
|
||||||
class simple_alloc
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef void value_type;
|
|
||||||
typedef value_type * pointer;
|
|
||||||
typedef const void* const_pointer;
|
|
||||||
typedef std::size_t size_type;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
|
|
||||||
simple_alloc(){}
|
|
||||||
simple_alloc(const simple_alloc&){}
|
|
||||||
|
|
||||||
~simple_alloc(){}
|
|
||||||
|
|
||||||
pointer allocate(size_type n, const void* = 0)
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
|
||||||
return n != 0 ?
|
|
||||||
reinterpret_cast<pointer>(alloc_type::allocate(n))
|
|
||||||
: 0;
|
|
||||||
#else
|
|
||||||
return n != 0 ?
|
|
||||||
reinterpret_cast<pointer>(::operator new(n))
|
|
||||||
: 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
|
||||||
{
|
|
||||||
#ifdef BOOST_HAVE_SGI_ALLOCATOR
|
|
||||||
BOOST_ASSERT( (p == 0) == (n == 0) );
|
|
||||||
if (p != 0)
|
|
||||||
alloc_type::deallocate((void*)p, n);
|
|
||||||
#else
|
|
||||||
BOOST_ASSERT( (p == 0) == (n == 0) );
|
|
||||||
if (p != 0)
|
|
||||||
::operator delete((void*)p);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class Base>
|
|
||||||
class allocator_adapter : public Base
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef T value_type;
|
|
||||||
typedef value_type * pointer;
|
|
||||||
typedef const T* const_pointer;
|
|
||||||
typedef T& reference;
|
|
||||||
typedef const T& const_reference;
|
|
||||||
typedef size_t size_type;
|
|
||||||
typedef std::ptrdiff_t difference_type;
|
|
||||||
typedef Base base_type;
|
|
||||||
|
|
||||||
allocator_adapter(){}
|
|
||||||
allocator_adapter(const base_type& x) : Base(x){}
|
|
||||||
allocator_adapter& operator=(const base_type& x)
|
|
||||||
{
|
|
||||||
*(static_cast<base_type*>(this)) = x;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
~allocator_adapter(){}
|
|
||||||
|
|
||||||
pointer address(reference x) { return &x; }
|
|
||||||
|
|
||||||
const_pointer address(const_reference x) const { return &x; }
|
|
||||||
|
|
||||||
pointer allocate(size_type n, const void* = 0)
|
|
||||||
{
|
|
||||||
return n != 0 ?
|
|
||||||
reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
|
|
||||||
: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
|
||||||
{
|
|
||||||
BOOST_ASSERT( (p == 0) == (n == 0) );
|
|
||||||
if (p != 0)
|
|
||||||
static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_type max_size() const
|
|
||||||
{ return size_t(-1) / sizeof(value_type); }
|
|
||||||
|
|
||||||
void construct(pointer p, const T& val) const
|
|
||||||
{ allocator_construct(p, val); }
|
|
||||||
|
|
||||||
void destroy(pointer p) const
|
|
||||||
{ allocator_destroy(p); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T, class A>
|
|
||||||
struct rebind_allocator
|
|
||||||
{
|
|
||||||
typedef allocator_adapter<T, typename A::base_type> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // include guard
|
|
@ -1,204 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 1998-2002
|
|
||||||
* 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 regex_libary_include.hpp
|
|
||||||
* VERSION see <boost/version.hpp>
|
|
||||||
* DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
|
|
||||||
* Note this is an internal header file included
|
|
||||||
* by regex.hpp, do not include on its own.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*************************************************************************
|
|
||||||
|
|
||||||
Libraries for Borland and Microsoft compilers are automatically
|
|
||||||
selected here, the name of the lib is selected according to the following
|
|
||||||
formula:
|
|
||||||
|
|
||||||
BOOST_LIB_PREFIX
|
|
||||||
+ BOOST_LIB_NAME
|
|
||||||
+ "_"
|
|
||||||
+ BOOST_LIB_TOOLSET
|
|
||||||
+ "_"
|
|
||||||
+ BOOST_LIB_THREAD_OPT
|
|
||||||
+ BOOST_LIB_RT_OPT
|
|
||||||
+ BOOST_LIB_DEBUG_OPT
|
|
||||||
|
|
||||||
These are defined as:
|
|
||||||
|
|
||||||
BOOST_LIB_PREFIX: "lib" for static libraries otherwise "".
|
|
||||||
|
|
||||||
BOOST_LIB_NAME: The base name of the lib (boost_regex).
|
|
||||||
|
|
||||||
BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
|
|
||||||
|
|
||||||
BOOST_LIB_THREAD_OPT: "s" for single thread builds,
|
|
||||||
"m" for multithread builds.
|
|
||||||
|
|
||||||
BOOST_LIB_RT_OPT: "s" for static runtime,
|
|
||||||
"d" for dynamic runtime.
|
|
||||||
|
|
||||||
BOOST_LIB_DEBUG_OPT: nothing for release builds,
|
|
||||||
"d" for debug builds,
|
|
||||||
"dd" for debug-diagnostic builds (_STLP_DEBUG).
|
|
||||||
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(BOOST_REGEX_LIBRARY_INCLUDE_HPP) && !defined(BOOST_REGEX_NO_LIB)
|
|
||||||
#define BOOST_REGEX_LIBRARY_INCLUDE_HPP
|
|
||||||
|
|
||||||
#define BOOST_LIB_NAME "boost_regex"
|
|
||||||
|
|
||||||
//
|
|
||||||
// select toolset:
|
|
||||||
//
|
|
||||||
#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
|
||||||
|
|
||||||
// vc6-stlport:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc6-stlport"
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
|
|
||||||
|
|
||||||
// vc6:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc6"
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
|
||||||
|
|
||||||
// vc6-stlport:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc7-stlport"
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
|
|
||||||
|
|
||||||
// vc7:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc7"
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
|
|
||||||
|
|
||||||
// vc71-stlport:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc71-stlport"
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310)
|
|
||||||
|
|
||||||
// vc71:
|
|
||||||
# define BOOST_LIB_TOOLSET "vc71"
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560)
|
|
||||||
|
|
||||||
// CBuilder 6:
|
|
||||||
# define BOOST_LIB_TOOLSET "bcb6"
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
|
|
||||||
|
|
||||||
// CBuilder 6:
|
|
||||||
# define BOOST_LIB_TOOLSET "bcb5"
|
|
||||||
|
|
||||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x540)
|
|
||||||
|
|
||||||
// CBuilder 6:
|
|
||||||
# define BOOST_LIB_TOOLSET "bcb4"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// select thread opt:
|
|
||||||
//
|
|
||||||
#if defined(_MT) || defined(__MT__)
|
|
||||||
# define BOOST_LIB_THREAD_OPT "m"
|
|
||||||
#else
|
|
||||||
# define BOOST_LIB_THREAD_OPT "s"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// select runtime opt:
|
|
||||||
//
|
|
||||||
#if defined(_DLL) || defined(_RTLDLL)
|
|
||||||
# define BOOST_LIB_RT_OPT "d"
|
|
||||||
#else
|
|
||||||
# define BOOST_LIB_RT_OPT "s"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// select linkage opt:
|
|
||||||
//
|
|
||||||
#if defined(BOOST_REGEX_STATIC_LINK) && defined(BOOST_REGEX_DYN_LINK)
|
|
||||||
# undef BOOST_REGEX_STATIC_LINK
|
|
||||||
#endif
|
|
||||||
#if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_REGEX_DYN_LINK)
|
|
||||||
# define BOOST_LIB_PREFIX
|
|
||||||
#else
|
|
||||||
# define BOOST_LIB_PREFIX "lib"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// select debug opt:
|
|
||||||
//
|
|
||||||
#if defined(BOOST_MSVC) && defined(_DEBUG) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
|
|
||||||
# define BOOST_LIB_DEBUG_OPT "dd"
|
|
||||||
#elif defined(BOOST_MSVC) && defined(_DEBUG)
|
|
||||||
# define BOOST_LIB_DEBUG_OPT "d"
|
|
||||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
|
|
||||||
# define BOOST_LIB_DEBUG_OPT "dd"
|
|
||||||
#else
|
|
||||||
# define BOOST_LIB_DEBUG_OPT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// now include the lib:
|
|
||||||
//
|
|
||||||
#if defined(BOOST_LIB_NAME) \
|
|
||||||
&& defined(BOOST_LIB_PREFIX) \
|
|
||||||
&& defined(BOOST_LIB_TOOLSET) \
|
|
||||||
&& defined(BOOST_LIB_THREAD_OPT) \
|
|
||||||
&& defined(BOOST_LIB_RT_OPT) \
|
|
||||||
&& defined(BOOST_LIB_DEBUG_OPT)
|
|
||||||
|
|
||||||
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib")
|
|
||||||
#ifdef BOOST_REGEX_DIAG
|
|
||||||
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
|
||||||
// finally undef any macros we may have set:
|
|
||||||
//
|
|
||||||
#if defined(BOOST_LIB_NAME)
|
|
||||||
# undef BOOST_LIB_NAME
|
|
||||||
#endif
|
|
||||||
#if defined(BOOST_LIB_TOOLSET)
|
|
||||||
# undef BOOST_LIB_TOOLSET
|
|
||||||
#endif
|
|
||||||
#if defined(BOOST_LIB_THREAD_OPT)
|
|
||||||
# undef BOOST_LIB_THREAD_OPT
|
|
||||||
#endif
|
|
||||||
#if defined(BOOST_LIB_RT_OPT)
|
|
||||||
# undef BOOST_LIB_RT_OPT
|
|
||||||
#endif
|
|
||||||
#if defined(BOOST_LIB_LINK_OPT)
|
|
||||||
# undef BOOST_LIB_LINK_OPT
|
|
||||||
#endif
|
|
||||||
#if defined(BOOST_LIB_DEBUG_OPT)
|
|
||||||
# undef BOOST_LIB_DEBUG_OPT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,7 +74,7 @@ private:
|
|||||||
std::ptrdiff_t m_paren_start; // where the last seen ')' began (where repeats are inserted).
|
std::ptrdiff_t m_paren_start; // where the last seen ')' began (where repeats are inserted).
|
||||||
std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative
|
std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative
|
||||||
bool m_has_case_change; // true if somewhere in the current block the case has changed
|
bool m_has_case_change; // true if somewhere in the current block the case has changed
|
||||||
#ifdef BOOST_MSVC
|
#if defined(BOOST_MSVC) && defined(_M_IX86)
|
||||||
// This is an ugly warning suppression workaround (for warnings *inside* std::vector
|
// This is an ugly warning suppression workaround (for warnings *inside* std::vector
|
||||||
// that can not otherwise be suppressed)...
|
// that can not otherwise be suppressed)...
|
||||||
BOOST_STATIC_ASSERT(sizeof(long) >= sizeof(void*));
|
BOOST_STATIC_ASSERT(sizeof(long) >= sizeof(void*));
|
||||||
|
@ -597,7 +597,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
|
|||||||
std::string name;
|
std::string name;
|
||||||
const charT* p0 = p1;
|
const charT* p0 = p1;
|
||||||
while(p0 != p2)
|
while(p0 != p2)
|
||||||
name.append(1, char(*p0++));
|
name.append(1, char(*p0++));
|
||||||
#endif
|
#endif
|
||||||
name = lookup_default_collate_name(name);
|
name = lookup_default_collate_name(name);
|
||||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||||
@ -608,13 +608,13 @@ typename cpp_regex_traits_implementation<charT>::string_type
|
|||||||
#else
|
#else
|
||||||
if(name.size())
|
if(name.size())
|
||||||
{
|
{
|
||||||
string_type result;
|
string_type result;
|
||||||
typedef std::string::const_iterator iter;
|
typedef std::string::const_iterator iter;
|
||||||
iter b = name.begin();
|
iter b = name.begin();
|
||||||
iter e = name.end();
|
iter e = name.end();
|
||||||
while(b != e)
|
while(b != e)
|
||||||
result.append(1, charT(*b++));
|
result.append(1, charT(*b++));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(p2 - p1 == 1)
|
if(p2 - p1 == 1)
|
||||||
|
@ -320,12 +320,12 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
|||||||
{
|
{
|
||||||
// independent sub-expression, currently this is always recursive:
|
// independent sub-expression, currently this is always recursive:
|
||||||
bool old_independent = m_independent;
|
bool old_independent = m_independent;
|
||||||
m_independent = true;
|
m_independent = true;
|
||||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||||
pstate = pstate->next.p->next.p;
|
pstate = pstate->next.p->next.p;
|
||||||
bool r = match_all_states();
|
bool r = match_all_states();
|
||||||
pstate = next_pstate;
|
pstate = next_pstate;
|
||||||
m_independent = old_independent;
|
m_independent = old_independent;
|
||||||
#ifdef BOOST_REGEX_MATCH_EXTRA
|
#ifdef BOOST_REGEX_MATCH_EXTRA
|
||||||
if(r && (m_match_flags & match_extra))
|
if(r && (m_match_flags & match_extra))
|
||||||
{
|
{
|
||||||
@ -489,7 +489,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
if(greedy)
|
if(greedy)
|
||||||
{
|
{
|
||||||
// try and take the repeat if we can:
|
// try and take the repeat if we can:
|
||||||
@ -553,7 +553,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
|||||||
return false;
|
return false;
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
if(greedy)
|
if(greedy)
|
||||||
{
|
{
|
||||||
// repeat for as long as we can:
|
// repeat for as long as we can:
|
||||||
@ -593,7 +593,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
|||||||
return match_dot_repeat_slow();
|
return match_dot_repeat_slow();
|
||||||
|
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::re_detail::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
|
unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::re_detail::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
|
||||||
if(rep->min > count)
|
if(rep->min > count)
|
||||||
{
|
{
|
||||||
@ -640,7 +640,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
|||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
@ -708,7 +708,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
|||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
@ -770,14 +770,14 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
|||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma option push -w-8008 -w-8066 -w-8004
|
#pragma option push -w-8008 -w-8066 -w-8004
|
||||||
#endif
|
#endif
|
||||||
typedef typename traits::char_class_type mask_type;
|
typedef typename traits::char_class_type mask_type;
|
||||||
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
|
||||||
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate->next.p);
|
const re_set_long<mask_type>* set = static_cast<const re_set_long<mask_type>*>(pstate->next.p);
|
||||||
std::size_t count = 0;
|
std::size_t count = 0;
|
||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
|
@ -127,12 +127,12 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
|||||||
{
|
{
|
||||||
// independent sub-expression:
|
// independent sub-expression:
|
||||||
bool old_independent = m_independent;
|
bool old_independent = m_independent;
|
||||||
m_independent = true;
|
m_independent = true;
|
||||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||||
pstate = pstate->next.p->next.p;
|
pstate = pstate->next.p->next.p;
|
||||||
r = match_all_states();
|
r = match_all_states();
|
||||||
pstate = next_pstate;
|
pstate = next_pstate;
|
||||||
m_independent = old_independent;
|
m_independent = old_independent;
|
||||||
#ifdef BOOST_REGEX_MATCH_EXTRA
|
#ifdef BOOST_REGEX_MATCH_EXTRA
|
||||||
if(r && (m_match_flags & match_extra))
|
if(r && (m_match_flags & match_extra))
|
||||||
{
|
{
|
||||||
@ -314,7 +314,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
if(greedy)
|
if(greedy)
|
||||||
{
|
{
|
||||||
// try and take the repeat if we can:
|
// try and take the repeat if we can:
|
||||||
@ -382,7 +382,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow()
|
|||||||
return false;
|
return false;
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
if(greedy)
|
if(greedy)
|
||||||
{
|
{
|
||||||
// normal repeat:
|
// normal repeat:
|
||||||
@ -444,7 +444,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast()
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4267)
|
#pragma warning(disable:4267)
|
||||||
#endif
|
#endif
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::re_detail::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
|
std::size_t count = (std::min)(static_cast<std::size_t>(::boost::re_detail::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
|
||||||
if(rep->min > count)
|
if(rep->min > count)
|
||||||
{
|
{
|
||||||
@ -505,7 +505,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
|
|||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
@ -594,7 +594,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
|
|||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
@ -684,7 +684,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
|
|||||||
//
|
//
|
||||||
// start by working out how much we can skip:
|
// start by working out how much we can skip:
|
||||||
//
|
//
|
||||||
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
|
||||||
std::size_t desired = greedy ? rep->max : rep->min;
|
std::size_t desired = greedy ? rep->max : rep->min;
|
||||||
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
if(::boost::is_random_access_iterator<BidiIterator>::value)
|
||||||
{
|
{
|
||||||
|
@ -396,7 +396,7 @@ typename w32_regex_traits_implementation<charT>::string_type
|
|||||||
std::string name;
|
std::string name;
|
||||||
const charT* p0 = p1;
|
const charT* p0 = p1;
|
||||||
while(p0 != p2)
|
while(p0 != p2)
|
||||||
name.append(1, char(*p0++));
|
name.append(1, char(*p0++));
|
||||||
#endif
|
#endif
|
||||||
name = lookup_default_collate_name(name);
|
name = lookup_default_collate_name(name);
|
||||||
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
||||||
@ -407,13 +407,13 @@ typename w32_regex_traits_implementation<charT>::string_type
|
|||||||
#else
|
#else
|
||||||
if(name.size())
|
if(name.size())
|
||||||
{
|
{
|
||||||
string_type result;
|
string_type result;
|
||||||
typedef std::string::const_iterator iter;
|
typedef std::string::const_iterator iter;
|
||||||
iter b = name.begin();
|
iter b = name.begin();
|
||||||
iter e = name.end();
|
iter e = name.end();
|
||||||
while(b != e)
|
while(b != e)
|
||||||
result.append(1, charT(*b++));
|
result.append(1, charT(*b++));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(p2 - p1 == 1)
|
if(p2 - p1 == 1)
|
||||||
|
Reference in New Issue
Block a user