Changes between Initial Version and Version 1 of Ticket #12094, comment 1


Ignore:
Timestamp:
Mar 24, 2016, 10:34:33 AM (7 years ago)
Author:
Joel de Guzman

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12094, comment 1

    initial v1  
    1 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
     1It may be unintuitive, but it is not really a bug. Sequences (including expect operators in x3) may accept a tuple or 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
    22
    33But 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.