|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67441 - in trunk: boost/spirit/home/karma/detail libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-23 21:10:13
Author: hkaiser
Date: 2010-12-23 21:10:11 EST (Thu, 23 Dec 2010)
New Revision: 67441
URL: http://svn.boost.org/trac/boost/changeset/67441
Log:
Spirit: fixing Karma string literal problem
Text files modified:
trunk/boost/spirit/home/karma/detail/string_compare.hpp | 4 ++--
trunk/libs/spirit/test/karma/lit.cpp | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
Modified: trunk/boost/spirit/home/karma/detail/string_compare.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/string_compare.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/string_compare.hpp 2010-12-23 21:10:11 EST (Thu, 23 Dec 2010)
@@ -32,7 +32,7 @@
ch_lit = *++lit;
}
- return true;
+ return !ch_lit && !ch_attr;
}
template <typename Char>
@@ -62,7 +62,7 @@
ch_lit = spirit::char_class::convert<CharEncoding>::to(Tag(), *++lit);
}
- return true;
+ return !ch_lit && !ch_attr;
}
template <typename Char, typename CharEncoding, typename Tag>
Modified: trunk/libs/spirit/test/karma/lit.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/lit.cpp (original)
+++ trunk/libs/spirit/test/karma/lit.cpp 2010-12-23 21:10:11 EST (Thu, 23 Dec 2010)
@@ -45,6 +45,7 @@
BOOST_TEST(test("abc", string("abc"), "abc"));
BOOST_TEST(!test("", string("abc"), "abcd"));
BOOST_TEST(!test("", string("abcd"), "abc"));
+ BOOST_TEST(!test("", string("abc"), "abcd")); // don't match prefixes only
}
{
@@ -118,6 +119,7 @@
BOOST_TEST(test_delimited("abc ", string("abc"), "abc", ' '));
BOOST_TEST(!test_delimited("", string("abc"), "abcd", ' '));
BOOST_TEST(!test_delimited("", string("abcd"), "abc", ' '));
+ BOOST_TEST(!test_delimited("", string("abc"), "abcd", ' ')); // don't match prefixes only
}
{
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