Subject: [Boost-bugs] [Boost C++ Libraries] #2017: leaf_node_d matches leading skip tokens
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-18 09:49:12
#2017: leaf_node_d matches leading skip tokens
-------------------------------------+--------------------------------------
Reporter: j.swoboda_at_[hidden] | Owner: djowel
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: spirit
Version: Boost 1.35.0 | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
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.
Example:
Add a skip parser to libs/spirit/example/fundamental/ast_calc.cpp line
131:
tree_parse_info<> info = ast_parse(str.c_str(), calc, ch_p('a'));
Build and feed the program with "1+a2" (called input a) or "a1+a2" (called
input b).
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.
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.
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.
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2017>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC