Boost C++ Libraries: Ticket #1048: Spirit returns full = false in 1.34 if there is trailing spaces in input https://svn.boost.org/trac10/ticket/1048 <p> In boost 1.34, if there is a trailing white space characters in an input sequence, parse returns with info.full set to false, even though parsing was (essentially) full. The space_p skip parser is ignored for the last sequence. In 1.33 parsing succeeds as expected. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1048 Trac 1.4.3 biochimia Mon, 18 Jun 2007 02:26:10 GMT status, summary changed; resolution set https://svn.boost.org/trac10/ticket/1048#comment:1 https://svn.boost.org/trac10/ticket/1048#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> <li><strong>summary</strong> <span class="trac-field-old">Spirit returns full = false in 1.3.4 if there is trailing spaces in input</span> → <span class="trac-field-new">Spirit returns full = false in 1.34 if there is trailing spaces in input</span> </li> </ul> <p> The change in behaviour was intentional. It was made on the grounds of consistency (parsers shouldn't consume any more output than what they have matched), as well as to avoid a hang when directly parsing stdin: namely, parse() would hang waiting for a non-whitespace character at the end of a match. </p> <p> You may workaround this change by adding eps_p or end_p after your grammar, as in: </p> <div class="wiki-code"><div class="code"><pre><span class="n">my_grammar</span> <span class="n">g</span><span class="p">;</span> <span class="n">my_skipper</span> <span class="n">skipper</span><span class="p">;</span> <span class="n">parse</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="n">g</span> <span class="o">&gt;&gt;</span> <span class="n">eps_p</span><span class="p">,</span> <span class="n">skipper</span><span class="p">);</span> <span class="c1">// 1</span> <span class="n">parse</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="n">g</span> <span class="o">&gt;&gt;</span> <span class="n">end_p</span><span class="p">,</span> <span class="n">skipper</span><span class="p">);</span> <span class="c1">// 2</span> </pre></div></div><p> The 2nd option requires a full match, while the first one gets you the previous behaviour without making a full match obligatory. </p> <p> Here's where the change was first announced, for context: </p> <blockquote> <p> <a class="ext-link" href="http://thread.gmane.org/gmane.comp.parsers.spirit.general/9839"><span class="icon">​</span>http://thread.gmane.org/gmane.comp.parsers.spirit.general/9839</a> </p> </blockquote> Ticket cdiggins@… Fri, 05 Oct 2007 03:14:59 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1048#comment:2 https://svn.boost.org/trac10/ticket/1048#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> <p> This new change in behaviour breaks the C parser example in the repository. Others in the repository may be broken as well, I haven't checked. </p> Ticket Marshall Clow Tue, 27 Nov 2007 15:58:05 GMT status changed; owner set https://svn.boost.org/trac10/ticket/1048#comment:3 https://svn.boost.org/trac10/ticket/1048#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Joel de Guzman</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket Joel de Guzman Tue, 27 Nov 2007 23:20:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1048#comment:4 https://svn.boost.org/trac10/ticket/1048#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Author (Hartmut Kaiser) notified and web-page note on this issue added. I shall close this now. </p> Ticket