|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69599 - trunk/libs/spirit/test/qi
From: joel_at_[hidden]
Date: 2011-03-06 00:41:29
Author: djowel
Date: 2011-03-06 00:41:28 EST (Sun, 06 Mar 2011)
New Revision: 69599
URL: http://svn.boost.org/trac/boost/changeset/69599
Log:
Bug?
Text files modified:
trunk/libs/spirit/test/qi/sequence.cpp | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
Modified: trunk/libs/spirit/test/qi/sequence.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/sequence.cpp (original)
+++ trunk/libs/spirit/test/qi/sequence.cpp 2011-03-06 00:41:28 EST (Sun, 06 Mar 2011)
@@ -113,12 +113,12 @@
}
{
- // make sure single element tuples get passed through if the rhs
+ // make sure single element tuples get passed through if the rhs
// has a single element tuple as its attribute
vector<double, int> fv;
rule<char const*, vector<double, int>()> r;
r %= double_ >> ',' >> int_;
- BOOST_TEST((test_attr("test:2.0,1", "test:" >> r, fv) &&
+ BOOST_TEST((test_attr("test:2.0,1", "test:" >> r, fv) &&
fv == vector<double, int>(2.0, 1)));
}
@@ -235,7 +235,7 @@
// stl containers of stl containers.
{
std::vector<std::string> v;
- BOOST_TEST(test_attr("abc1,abc2",
+ BOOST_TEST(test_attr("abc1,abc2",
*~char_(',') >> *(',' >> *~char_(',')), v));
BOOST_TEST(v.size() == 2 && v[0] == "abc1" && v[1] == "abc2");
}
@@ -255,7 +255,7 @@
// do the same with a plain string object
{
std::string s;
- BOOST_TEST(test_attr("abc1,abc2",
+ BOOST_TEST(test_attr("abc1,abc2",
*~char_(',') >> *(',' >> *~char_(',')), s));
BOOST_TEST(s == "abc1abc2");
}
@@ -323,6 +323,16 @@
print_info(what(alpha | char_('x') >> lit("hello") >> int_));
}
+ { // compile check only
+ using boost::spirit::qi::rule;
+ typedef boost::fusion::vector<int, double> tuple_type;
+ typedef std::vector<boost::fusion::vector<int, double> > attr_type;
+
+ rule<char const*, tuple_type()> r = int_ >> ',' >> double_;
+ rule<char const*, attr_type()> r2 = r >> *(',' >> r);
+ //~ rule<char const*, attr_type()> r2 = r % ',';
+ }
+
return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk