spirit_x3 icon indicating copy to clipboard operation
spirit_x3 copied to clipboard

lit("...") stores its match into the rule attribute

Open jktjkt opened this issue 11 years ago • 2 comments

This test case fails:

{
    // literals wrapping strings shall not be stored
    std::string attr;
    test_attr("foo", lit("foo"), attr, true);
    BOOST_TEST((attr.empty()));
}

...while this one suceeds:

{
    // same as above, but with lit(char)
    std::string attr;
    test_attr("foo", lit('f') >> lit('o') >> lit('o'), attr, true);
    BOOST_TEST((attr.empty()));
}

jktjkt avatar Oct 21 '13 00:10 jktjkt

This test case is also failing:

{
    // same as above, but with lit(char)
    char attr = 0;
    BOOST_TEST((test_attr("f", lit('f'), attr, true)));
    BOOST_TEST((!attr));
}

K-ballo avatar Oct 26 '13 21:10 K-ballo

I believe this was fixed in https://github.com/boostorg/spirit/pull/6

redbaron avatar Mar 21 '14 08:03 redbaron