Re: [Boost-bugs] [Boost C++ Libraries] #12094: Operator > changes attribute type

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12094: Operator > changes attribute type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-03-24 10:33:22


#12094: Operator > changes attribute type
-----------------------------------+---------------------
  Reporter: mikhail.strelnikov@… | Owner: djowel
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+---------------------

Comment (by djowel):

 It may be unintuitive, but it is not really a bug. Sequences (including
 expect operators in x3) may accept a tuple of container (e.g. string). If
 it gets a container, it expects its nodes to have an attribute of either a
 container, or the container's value type. See
 http://www.boost.org/doc/libs/1_60_0/libs/spirit/doc/html/spirit/qi/reference/operator/sequence.html

 But what is the natural (inherent) attribute type of (r | r)? It is a
 variant, not a container. That is why X3 got tripped. It can't handle the
 ambiguity. X3's attribute handling mechanism is not perfect. As it
 descends into the alternative, it already decided that it's attribute
 cannot handle the container, and thus tries to pass the element type of
 the container.

 Tip: Don't fight the attribute mechanism. Try to form your attributes as
 closely as possible to the rules and grammars that models it.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12094#comment:1>
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:50:19 UTC