Consider the following code:
TEST_CASE("Requirements Parser Description", "[test]")
{
namespace x3 = ::boost::spirit::x3;
std::string s = "### Description\n\nSome\nmultiline\ntext."
"\n\n### Attributes";
std::string expectedValue = "Some\nmultiline\ntext.";
auto rule = x3::lit("### ") >> x3::lit("Description")
>> (x3::lexeme
[+x3::char_
- (x3::lit("###") >> *x3::space >> x3::lit("Attributes"))]);
std::string value;
bool success = x3::phrase_parse(s.begin(), s.end(), rule, x3::space, value);
REQUIRE(success);
REQUIRE(value == expectedValue);
}
which yields the following output:
test_boost_spirit_x3_parser.cpp:183: FAILED:
REQUIRE( value == expectedValue )
with expansion:
"Some
multiline
text.
### Attributes"
==
"Some
multiline
text."
Any explanation why the minus operator does not work as I expect? Any fixes at hand?