Boost C++ Libraries: Ticket #2017: leaf_node_d matches leading skip tokens https://svn.boost.org/trac10/ticket/2017 <p> Since spirit 1.86 (boost 1.35.0) the match of leaf_node_d contains any skip tokens directly before the actual match, if there was another token before. </p> <p> Example: Add a skip parser to libs/spirit/example/fundamental/ast_calc.cpp line 131: </p> <blockquote> <p> tree_parse_info&lt;&gt; info = ast_parse(str.c_str(), calc, ch_p('a')); </p> </blockquote> <p> Build and feed the program with "1+a2" (called input a) or "a1+a2" (called input b). </p> <p> Output: (a) The parse tree has a root node "+" with two child nodes "1" and "a2", the calculation yields "1" (due to being unable to convert "a2" to a number). (b) Results in the same parse tree as (a), that is, the leading skip token is in fact ignored, but not any subsequent ones. </p> <p> Expected output: The second child node should only contain "2". This can be achieved by replacing leaf_node_d with reduced_node_d in tree_calc_grammar.hpp. </p> <p> Relevance: This renders leaf_node_d useless in conjunction with skip parsers and breaks the runtime behaviour of existing grammars. Feel free to upgrade it to Showstopper. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2017 Trac 1.4.3 anonymous Fri, 13 Mar 2009 01:00:17 GMT severity changed https://svn.boost.org/trac10/ticket/2017#comment:1 https://svn.boost.org/trac10/ticket/2017#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> </ul> <p> Having exactly the same problem... </p> Ticket Joel de Guzman Fri, 13 Mar 2009 01:19:02 GMT owner changed https://svn.boost.org/trac10/ticket/2017#comment:2 https://svn.boost.org/trac10/ticket/2017#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Joel de Guzman</span> to <span class="trac-author">Hartmut Kaiser</span> </li> </ul> <p> Hartmut, I'm reassigning this to you. I am assuming you are the maintainer of "Classic" AST/PTs? </p> Ticket anonymous Tue, 09 Jun 2009 00:26:25 GMT <link>https://svn.boost.org/trac10/ticket/2017#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2017#comment:3</guid> <description> <p> This doesn't always seem to happen. You can't blindly replace leaf_node_d with reduced_node_d. </p> </description> <category>Ticket</category> </item> <item> <author>Peter Schüller <schueller.p@…></author> <pubDate>Thu, 20 Aug 2009 16:16:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2017#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2017#comment:4</guid> <description> <p> I also have this problem, so far i had to resort to extra postprocessing. regex_p would be an alternative, but it requires a bidirectional iterator which is a problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Mon, 21 Sep 2009 22:09:38 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2017#comment:5 https://svn.boost.org/trac10/ticket/2017#comment:5 <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> </ul> <p> After the release of Spirit 2.1 in Boost V1.41 this is not relevant anymore. </p> Ticket OP Wed, 23 Sep 2009 16:43:18 GMT <link>https://svn.boost.org/trac10/ticket/2017#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2017#comment:6</guid> <description> <p> Interesting solution. Will you be waiting out future bugs as well? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 23 Sep 2009 17:20:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2017#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2017#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2017#comment:6" title="Comment 6">OP</a>: </p> <blockquote class="citation"> <p> Interesting solution. Will you be waiting out future bugs as well? </p> </blockquote> <p> Well, we didn't wait it out, we just fixed it in the new version. What else do you expect? </p> <p> Regards Hartmut </p> </description> <category>Ticket</category> </item> </channel> </rss>