Boost C++ Libraries: Ticket #13313: Problem when mixing repeat with epsilon parser https://svn.boost.org/trac10/ticket/13313 <p> Mixing lazy repeats with epsilon parser (with action) is not working as expected. The attributes are not synthesized as expected. The following example fails: </p> <pre class="wiki"> std::string s; size_t c = 0; BOOST_TEST(test_attr("aaaaaaaa", repeat(val(8))[char_ &gt;&gt; eps[ref(c)++]], s) &amp;&amp; s == "aaaaaaaa" &amp;&amp; c == 8); </pre><p> It failed because <em>s</em> is empty (which I don't think it should) </p> <p> I have made some variation of the same operations (no actions, no lazy operations) and they all works except for this particular case. </p> <p> See the complete example that I have made from the repeat.cpp test (only the last test fails): </p> <pre class="wiki"> { using boost::spirit::qi::eps; using boost::phoenix::val; using boost::phoenix::ref; std::string s; size_t c = 0; s.clear(); BOOST_TEST(test_attr("aaaaaaaa", repeat[char_ &gt;&gt; eps], s) &amp;&amp; s == "aaaaaaaa"); s.clear(); BOOST_TEST(test_attr("aaaaaaaa", repeat(8)[char_ &gt;&gt; eps], s) &amp;&amp; s == "aaaaaaaa"); s.clear(); BOOST_TEST(test_attr("aaaaaaaa", repeat(val(8))[char_ &gt;&gt; eps], s) &amp;&amp; s == "aaaaaaaa"); s.clear(); c = 0; BOOST_TEST(test_attr("aaaaaaaa", repeat[char_ &gt;&gt; eps[ref(c)++]], s) &amp;&amp; s == "aaaaaaaa" &amp;&amp; c == 8); s.clear(); c = 0; BOOST_TEST(test_attr("aaaaaaaa", repeat(8)[char_ &gt;&gt; eps[ref(c)++]], s) &amp;&amp; s == "aaaaaaaa" &amp;&amp; c == 8); s.clear(); c = 0; BOOST_TEST(test_attr("aaaaaaaa", repeat(val(8))[char_ &gt;&gt; eps[ref(c)++]], s) &amp;&amp; s == "aaaaaaaa" &amp;&amp; c == 8); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13313 Trac 1.4.3 Sebastien Matte <sebastien.matte83@…> Tue, 28 Nov 2017 02:47:23 GMT attachment set https://svn.boost.org/trac10/ticket/13313 https://svn.boost.org/trac10/ticket/13313 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">repeat.cpp</span> </li> </ul> <p> Modified repeat.cpp test with the included problem </p> Ticket Nikita Kniazev <nok.raven@…> Tue, 05 Dec 2017 18:36:38 GMT <link>https://svn.boost.org/trac10/ticket/13313#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13313#comment:1</guid> <description> <p> It looks like <a class="ext-link" href="http://boost.2283326.n4.nabble.com/Auto-attributes-propagation-in-directives-with-lazy-arguments-td4672231.html"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/Auto-attributes-propagation-in-directives-with-lazy-arguments-td4672231.html</a> problem. Do you agree? </p> </description> <category>Ticket</category> </item> </channel> </rss>