forked from boostorg/regex
Compare commits
29 Commits
boost-1.72
...
feature/up
Author | SHA1 | Date | |
---|---|---|---|
91892ab07d | |||
bb9c3b68d4 | |||
4788894218 | |||
b0eb5ccb20 | |||
a1d0c4fdc4 | |||
12fd320f3c | |||
3b98dc901a | |||
b5d60694cc | |||
082437d4fd | |||
aacd14bf71 | |||
a3814a31e9 | |||
6d00984aa9 | |||
edcbf059d7 | |||
f63c602e6a | |||
92f6a803a5 | |||
957d2f1bca | |||
c07e8c4f80 | |||
45d12f199d | |||
634fa6847e | |||
7ec82a06d4 | |||
e54e8e0173 | |||
bb0c610591 | |||
3d44eca405 | |||
e72490638a | |||
3168641320 | |||
3d72b06e9d | |||
0baf08108f | |||
9b6a8e5e82 | |||
ac03c4fecc |
88
.travis.yml
88
.travis.yml
@ -4,18 +4,11 @@
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
@ -27,6 +20,20 @@ matrix:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
env: TEST_CMAKE=true # variables unused - just for identification in travis ci gui
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake .. -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
|
||||
- cmake --build .
|
||||
|
||||
- os: linux
|
||||
env: TEST_CMAKE=true BUILD_SHARED_LIBS=On # variables unused - just for identification in travis ci gui
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake .. -DBUILD_SHARED_LIBS=ON -DBOOST_ENABLE_CMAKE=ON -DBOOST_INCLUDE_LIBRARIES=regex -DBOOST_REGEX_INCLUDE_EXAMPLES=ON
|
||||
- cmake --build .
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
|
||||
|
||||
@ -241,60 +248,27 @@ matrix:
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
|
||||
osx_image: xcode6.4
|
||||
# On this image, git doesn't support --jobs 3
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/regex
|
||||
- python tools/boostdep/depinst/depinst.py -I example regex
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/headers
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init libs/core
|
||||
- git submodule update --init libs/container_hash
|
||||
- git submodule update --init libs/detail
|
||||
- git submodule update --init libs/smart_ptr
|
||||
- git submodule update --init libs/predef
|
||||
- git submodule update --init libs/assert
|
||||
- git submodule update --init libs/throw_exception
|
||||
- git submodule update --init libs/mpl
|
||||
- git submodule update --init libs/type_traits
|
||||
- git submodule update --init libs/static_assert
|
||||
- git submodule update --init libs/integer
|
||||
- git submodule update --init libs/preprocessor
|
||||
- git submodule update --init libs/functional
|
||||
- git submodule update --init libs/program_options
|
||||
- git submodule update --init libs/chrono
|
||||
- git submodule update --init libs/system
|
||||
- git submodule update --init libs/thread
|
||||
- git submodule update --init libs/winapi
|
||||
- git submodule update --init libs/move
|
||||
- git submodule update --init libs/date_time
|
||||
- git submodule update --init libs/ratio
|
||||
- git submodule update --init libs/iterator
|
||||
- git submodule update --init libs/range
|
||||
- git submodule update --init libs/any
|
||||
- git submodule update --init libs/concept_check
|
||||
- git submodule update --init libs/array
|
||||
- git submodule update --init libs/timer
|
||||
- git submodule update --init libs/bind
|
||||
- git submodule update --init libs/utility
|
||||
- git submodule update --init libs/io
|
||||
- git submodule update --init libs/intrusive
|
||||
- git submodule update --init libs/container
|
||||
- git submodule update --init libs/tuple
|
||||
- git submodule update --init libs/exception
|
||||
- git submodule update --init libs/function
|
||||
- git submodule update --init libs/type_index
|
||||
- git submodule update --init libs/lexical_cast
|
||||
- git submodule update --init libs/numeric
|
||||
- git submodule update --init libs/math
|
||||
- git submodule update --init libs/tokenizer
|
||||
- git submodule update --init libs/optional
|
||||
- git submodule update --init libs/atomic
|
||||
- git submodule update --init libs/rational
|
||||
- git submodule update --init libs/algorithm
|
||||
- git submodule update --init tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/regex
|
||||
- python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
|
103
CMakeLists.txt
Normal file
103
CMakeLists.txt
Normal file
@ -0,0 +1,103 @@
|
||||
# Copyright 2018-2019 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
# NOTE: CMake support for Boost.Regex is currently experimental at best
|
||||
# and the interface is likely to change in the future
|
||||
|
||||
|
||||
##### How-To:
|
||||
#
|
||||
# If you have a cmake project that wants to use and compile
|
||||
# boost_regex, as part of a single build system run, do the following:
|
||||
# 1) clone the boost project and all its sub-projects:
|
||||
#
|
||||
# git clone --branch develop --depth 1 --recursive --shallow-submodules https://github.com/boostorg/boost.git boost-root
|
||||
#
|
||||
# 2) add to your cmake script:
|
||||
#
|
||||
# add_subdirectory( <path-to-boost-root> [<build-dir-for-boost-libs>])
|
||||
# target_link_libraries( <my-exec> PUBLIC Boost::regex)
|
||||
#
|
||||
# 3) run your cmake build as usual
|
||||
#
|
||||
# ## Explanation:
|
||||
#
|
||||
# Currently this file does not work standalone. It is expected to be
|
||||
# invoked from a parent script via add_subdirectory. That parent script
|
||||
# is responsible for providing targets for direct and indirect dependencies,
|
||||
# such as Boost::assert, Boost::concept_check, e.g. by also adding those
|
||||
# libraries via add_submodule (order doesn't matter).
|
||||
# The parent script can be your own cmake script, but it is easier to just
|
||||
# use add the CMakeLists in the root of the boost super project, which
|
||||
# will in turn add all boost libraries usable with the add_subdirectory
|
||||
# Workflow.
|
||||
#
|
||||
# Note: You don't need to actually clone all boost libraries. E.g. look
|
||||
# into the travis ci file to see on which libraries boost_regex actually
|
||||
# depends or use boostdep https://github.com/boostorg/boostdep
|
||||
|
||||
|
||||
##### Current Limitations:
|
||||
#
|
||||
# - Doesn't compile or run tests
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.5...3.16 )
|
||||
project( boost_regex VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
|
||||
|
||||
option( BOOST_REGEX_INCLUDE_EXAMPLES "Also build (some) boost regex examples" OFF )
|
||||
option( BOOST_REGEX_USE_ICU "Enable ICU support in boost regex" OFF )
|
||||
|
||||
file( GLOB BOOST_REGEX_SRC ./src/*.cpp )
|
||||
|
||||
add_library( boost_regex ${BOOST_REGEX_SRC} )
|
||||
add_library( Boost::regex ALIAS boost_regex )
|
||||
|
||||
target_include_directories( boost_regex PUBLIC include )
|
||||
|
||||
target_compile_definitions( boost_regex
|
||||
PUBLIC
|
||||
# No need for autolink
|
||||
BOOST_REGEX_NO_LIB
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:boost_regex,TYPE>,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1>
|
||||
)
|
||||
|
||||
# Specify dependencies (including header-only libraries)
|
||||
target_link_libraries( boost_regex
|
||||
PUBLIC
|
||||
Boost::assert
|
||||
Boost::concept_check
|
||||
Boost::config
|
||||
Boost::container_hash
|
||||
Boost::core
|
||||
Boost::integer
|
||||
Boost::iterator
|
||||
Boost::mpl
|
||||
Boost::predef
|
||||
Boost::smart_ptr
|
||||
Boost::static_assert
|
||||
Boost::throw_exception
|
||||
Boost::type_traits
|
||||
)
|
||||
|
||||
if( BOOST_REGEX_USE_ICU )
|
||||
# ICU Targets could be provided by parent project,
|
||||
# if not, look for them ourselves
|
||||
if( NOT TARGET ICU::dt )
|
||||
# components need to be listed explicitly
|
||||
find_package( ICU COMPONENTS dt in uc REQUIRED )
|
||||
endif()
|
||||
|
||||
target_link_libraries( boost_regex
|
||||
PRIVATE
|
||||
ICU::dt ICU::in ICU::uc
|
||||
)
|
||||
target_compile_definitions( boost_regex PRIVATE BOOST_HAS_ICU=1 )
|
||||
endif()
|
||||
|
||||
if( BOOST_REGEX_INCLUDE_EXAMPLES )
|
||||
add_subdirectory( example/snippets )
|
||||
endif()
|
||||
|
@ -116,7 +116,7 @@ if ! $(disable-icu)
|
||||
|
||||
}
|
||||
|
||||
unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
|
||||
exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
|
||||
explicit has_icu ;
|
||||
|
||||
alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;
|
||||
|
@ -8,12 +8,11 @@
|
||||
|
||||
[section:history History]
|
||||
|
||||
New issues should be submitted at [@http://svn.boost.org svn.boost.org] - don't forget to include your
|
||||
email address in the ticket!
|
||||
New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues]
|
||||
|
||||
Currently open issues can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
||||
Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here].
|
||||
|
||||
All issues including closed ones can be viewed [@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=regex&order=priority&col=id&col=summary&col=status&col=type&col=milestone&col=component here].
|
||||
All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here].
|
||||
|
||||
[h4 Boost.Regex-5.1.4 (Boost-172.0)]
|
||||
|
||||
|
30
example/snippets/CMakeLists.txt
Normal file
30
example/snippets/CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
||||
# Copyright 2019 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
# NOTE: CMake support for Boost.Regex is currently experimental at best
|
||||
# and we are currently only building a few examples
|
||||
|
||||
set(examples
|
||||
partial_regex_grep
|
||||
partial_regex_iterate
|
||||
partial_regex_match
|
||||
regex_grep_example_1
|
||||
regex_grep_example_2
|
||||
regex_grep_example_3
|
||||
regex_grep_example_4
|
||||
regex_iterator_example
|
||||
regex_match_example
|
||||
regex_merge_example
|
||||
regex_replace_example
|
||||
regex_search_example
|
||||
regex_split_example_1
|
||||
regex_split_example_2
|
||||
regex_token_iterator_eg_1
|
||||
regex_token_iterator_eg_2
|
||||
)
|
||||
|
||||
foreach( example IN LISTS examples )
|
||||
add_executable( boost_regex_ex_${example} ${example}.cpp )
|
||||
target_link_libraries( boost_regex_ex_${example} Boost::regex )
|
||||
endforeach()
|
@ -859,7 +859,7 @@ escape_type_class_jump:
|
||||
{
|
||||
bool have_brace = false;
|
||||
bool negative = false;
|
||||
static const char* incomplete_message = "Incomplete \\g escape found.";
|
||||
static const char incomplete_message[] = "Incomplete \\g escape found.";
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
fail(regex_constants::error_escape, m_position - m_base, incomplete_message);
|
||||
@ -1133,7 +1133,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic)
|
||||
{
|
||||
static const char* incomplete_message = "Missing } in quantified repetition.";
|
||||
static const char incomplete_message[] = "Missing } in quantified repetition.";
|
||||
//
|
||||
// parse a repeat-range:
|
||||
//
|
||||
@ -1339,7 +1339,7 @@ bool basic_regex_parser<charT, traits>::parse_alt()
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::parse_set()
|
||||
{
|
||||
static const char* incomplete_message = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
|
||||
static const char incomplete_message[] = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
|
||||
++m_position;
|
||||
if(m_position == m_end)
|
||||
{
|
||||
@ -1431,7 +1431,7 @@ bool basic_regex_parser<charT, traits>::parse_set()
|
||||
template <class charT, class traits>
|
||||
bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, traits>& char_set)
|
||||
{
|
||||
static const char* incomplete_message = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
|
||||
static const char incomplete_message[] = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content.";
|
||||
//
|
||||
// we have either a character class [:name:]
|
||||
// a collating element [.name.]
|
||||
|
@ -50,6 +50,8 @@ class regex_iterator_implementation
|
||||
public:
|
||||
regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
|
||||
: base(), end(last), re(*p), flags(f){}
|
||||
regex_iterator_implementation(const regex_iterator_implementation& other)
|
||||
:what(other.what), base(other.base), end(other.end), re(other.re), flags(other.flags){}
|
||||
bool init(BidirectionalIterator first)
|
||||
{
|
||||
base = first;
|
||||
|
@ -141,7 +141,7 @@ inline bool is_separator<char>(char c)
|
||||
BOOST_REGEX_DECL std::string BOOST_REGEX_CALL lookup_default_collate_name(const std::string& name);
|
||||
|
||||
//
|
||||
// get the state_id of a character clasification, the individual
|
||||
// get the state_id of a character classification, the individual
|
||||
// traits classes then transform that state_id into a bitmask:
|
||||
//
|
||||
template <class charT>
|
||||
@ -208,8 +208,8 @@ int get_default_class_id(const charT* p1, const charT* p2)
|
||||
{data+63, data+67,}, // word
|
||||
{data+67, data+73,}, // xdigit
|
||||
};
|
||||
static const character_pointer_range<charT>* ranges_begin = ranges;
|
||||
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
|
||||
const character_pointer_range<charT>* ranges_begin = ranges;
|
||||
const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
|
||||
|
||||
character_pointer_range<charT> t = { p1, p2, };
|
||||
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
|
||||
|
@ -354,8 +354,8 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha
|
||||
};
|
||||
|
||||
|
||||
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
|
||||
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
|
||||
|
||||
BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, };
|
||||
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
|
||||
|
@ -193,7 +193,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining_implementation(boost::uint_l
|
||||
//
|
||||
// these are the POSIX collating names:
|
||||
//
|
||||
BOOST_REGEX_DECL const char* def_coll_names[] = {
|
||||
static const char* def_coll_names[] = {
|
||||
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "alert", "backspace", "tab", "newline",
|
||||
"vertical-tab", "form-feed", "carriage-return", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
|
||||
"SYN", "ETB", "CAN", "EM", "SUB", "ESC", "IS4", "IS3", "IS2", "IS1", "space", "exclamation-mark",
|
||||
@ -214,7 +214,7 @@ BOOST_REGEX_DECL const char* def_coll_names[] = {
|
||||
// little more - but this will have to do for
|
||||
// now:
|
||||
|
||||
BOOST_REGEX_DECL const char* def_multi_coll[] = {
|
||||
static const char* def_multi_coll[] = {
|
||||
"ae",
|
||||
"Ae",
|
||||
"AE",
|
||||
|
Reference in New Issue
Block a user