[Spirit2X] 2 problems with recent attribute handling changes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Spirit2X] 2 problems with recent attribute handling changes

Francois Barel
Hi,

In r1078 I added a new test in test/qi/raw.cpp (commented out), which
currently does not compile:
    BOOST_TEST((test_attr("x", raw[alpha] >> eps, range)));
giving:
    error C2039: 'push_back' :
        is not a member of 'boost::iterator_range<const char*>

I suspect the problem comes from the first parser's attribute
(boost::iterator_range) being confused as a STL container by the
recent attribute handling changes (r1054), but I don't fully
understand how pass_container et al. work yet. I'll try and take a
look over the week-end.


However by looking at the error message above, it looks like Spirit
attempts to push_back the attribute of the second parser (an eps) into
that iterator_range -- but the type of the attribute I see in error
messages is a char, which is strange for an eps?

While typing that, I realised that this is a second, larger problem
with the new attribute handling -- the second test below also fails:
    std::vector<char> vec;
    vec.clear();
    BOOST_TEST((test_attr("x", *alpha, vec) && vec.size() == 1));
    vec.clear();
    BOOST_TEST((test_attr("x", *alpha >> eps, vec) && vec.size() == 1));
vec.size() is 2 at the end: eps actually returned a meaningless char
attribute, which was push_back'd into vec.

Regards,
Fran├žois

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit2X] 2 problems with recent attribute handling changes

Joel de Guzman-2
Francois Barel wrote:

> Hi,
>
> In r1078 I added a new test in test/qi/raw.cpp (commented out), which
> currently does not compile:
>     BOOST_TEST((test_attr("x", raw[alpha] >> eps, range)));
> giving:
>     error C2039: 'push_back' :
>         is not a member of 'boost::iterator_range<const char*>
>
> I suspect the problem comes from the first parser's attribute
> (boost::iterator_range) being confused as a STL container by the
> recent attribute handling changes (r1054), but I don't fully
> understand how pass_container et al. work yet. I'll try and take a
> look over the week-end.
>
>
> However by looking at the error message above, it looks like Spirit
> attempts to push_back the attribute of the second parser (an eps) into
> that iterator_range -- but the type of the attribute I see in error
> messages is a char, which is strange for an eps?
>
> While typing that, I realised that this is a second, larger problem
> with the new attribute handling -- the second test below also fails:
>     std::vector<char> vec;
>     vec.clear();
>     BOOST_TEST((test_attr("x", *alpha, vec) && vec.size() == 1));
>     vec.clear();
>     BOOST_TEST((test_attr("x", *alpha >> eps, vec) && vec.size() == 1));
> vec.size() is 2 at the end: eps actually returned a meaningless char
> attribute, which was push_back'd into vec.

Fixed. I'll commit as soon as regression tests finish.

Regards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel