mirror of
https://github.com/boostorg/xpressive.git
synced 2025-05-11 05:13:57 +00:00
portability fixes
[SVN r46917]
This commit is contained in:
parent
79083632d5
commit
d4ba38f74c
7
include/boost/xpressive/detail/static/transforms/as_action.hpp
Executable file → Normal file
7
include/boost/xpressive/detail/static/transforms/as_action.hpp
Executable file → Normal file
@ -39,6 +39,13 @@ namespace boost { namespace xpressive { namespace detail
|
||||
typedef Matcher matcher_type;
|
||||
};
|
||||
|
||||
template<typename Nbr, typename Matcher>
|
||||
struct read_attr<Nbr, Matcher &>
|
||||
{
|
||||
typedef Nbr nbr_type;
|
||||
typedef Matcher matcher_type;
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
namespace boost { namespace xpressive { namespace grammar_detail
|
||||
|
9
test/misc2.cpp
Executable file → Normal file
9
test/misc2.cpp
Executable file → Normal file
@ -11,7 +11,8 @@
|
||||
#include <boost/xpressive/regex_actions.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
using namespace boost::xpressive;
|
||||
namespace xpr = boost::xpressive;
|
||||
using namespace xpr;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -34,7 +35,7 @@ void test_static_actions_in_dynamic_keep()
|
||||
std::string str("foo");
|
||||
|
||||
sregex_compiler compiler;
|
||||
compiler["rx0"] = (s1="foo")[ ref(result) = s1 ];
|
||||
compiler["rx0"] = (s1="foo")[ xpr::ref(result) = s1 ];
|
||||
sregex rx = compiler.compile("(?>(?$rx0))");
|
||||
|
||||
bool ok = regex_match(str, rx);
|
||||
@ -49,7 +50,7 @@ void test_static_actions_in_static_keep()
|
||||
std::string result;
|
||||
std::string str("foo");
|
||||
|
||||
sregex rx0 = (s1="foo")[ ref(result) = s1 ];
|
||||
sregex rx0 = (s1="foo")[ xpr::ref(result) = s1 ];
|
||||
sregex rx = keep(rx0);
|
||||
|
||||
bool ok = regex_match(str, rx);
|
||||
@ -69,7 +70,7 @@ void test_replace_with_lambda()
|
||||
std::string expected("\"this\" has the value \"that\"");
|
||||
sregex rx = "$(" >> (s1= +~as_xpr(')')) >> ')';
|
||||
|
||||
output = regex_replace(input, rx, ref(replacements)[s1]);
|
||||
output = regex_replace(input, rx, xpr::ref(replacements)[s1]);
|
||||
BOOST_CHECK_EQUAL(output, expected);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user