From 99c679026a134cc4632cc088ed609703519cd831 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Thu, 20 Aug 2015 00:14:27 +0200 Subject: [PATCH 1/2] X3: test case for expect directive with nested kleene star This testcase tries to use a kleene star within an expect directive. The test compiles but the parsed attribute is not as expected. --- test/x3/expect.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/x3/expect.cpp b/test/x3/expect.cpp index 5061e104c0..9eb140504f 100644 --- a/test/x3/expect.cpp +++ b/test/x3/expect.cpp @@ -101,6 +101,13 @@ main() BOOST_TEST((at_c<1>(attr) == 'b')); BOOST_TEST((at_c<2>(attr) == 'c')); } + + { + std::string attr; + BOOST_TEST((test_attr("'azaaz'", + "'" > *(char_("a") | char_("z")) > "'", attr, space))); + BOOST_TEST(attr == "azaaz"); + } } { From 7924736c8b4998799c33a25550c1d4edfd7615b7 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Thu, 20 Aug 2015 00:16:37 +0200 Subject: [PATCH 2/2] X3: set handles_container for expect directive --- include/boost/spirit/home/x3/directive/expect.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/spirit/home/x3/directive/expect.hpp b/include/boost/spirit/home/x3/directive/expect.hpp index 879d92c2df..d5e7b19cd2 100644 --- a/include/boost/spirit/home/x3/directive/expect.hpp +++ b/include/boost/spirit/home/x3/directive/expect.hpp @@ -39,6 +39,7 @@ namespace boost { namespace spirit { namespace x3 { typedef unary_parser > base_type; static bool const is_pass_through_unary = true; + static bool const handles_container = Subject::handles_container; expect_directive(Subject const& subject) : base_type(subject) {}