|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71576 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/date_time boost/date_time/posix_time boost/detail boost/filesystem boost/function boost/functional boost/functional/hash boost/fusion boost/fusion/container/list/detail boost/geometry boost/geometry/algorithms boost/geometry/arithmetic boost/geometry/core boost/geometry/domains boost/geometry/geometries boost/geometry/iterators boost/geometry/multi boost/geometry/policies boost/geometry/ranges boost/geometry/strategies boost/geometry/util boost/geometry/views boost/gil boost/graph boost/icl boost/integer boost/interprocess boost/intrusive boost/io boost/iostreams boost/iterator boost/math boost/msm boost/numeric/ublas boost/pool boost/program_options boost/program_options/detail boost/property_tree boost/python boost/range boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/karma/auto boost/spirit/home/karma/nonterminal boost/spirit/home/qi/nonterminal boost/spirit/home/qi/numeric boost/spirit/home/qi/numeric/detail boost/spirit/home/support boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/typeof boost/unordered boost/utility boost/uuid boost/variant boost/wave doc libs libs/algorithm/string libs/array libs/array/test libs/bimap libs/config libs/date_time libs/date_time/data libs/date_time/example/gregorian libs/date_time/example/local_time libs/date_time/example/posix_time libs/date_time/example/tutorial libs/date_time/test/posix_time libs/date_time/xmldoc libs/detail libs/filesystem libs/function libs/functional libs/functional/hash libs/fusion libs/geometry libs/geometry/doc libs/geometry/doc/concept libs/geometry/doc/doxy libs/geometry/doc/generated libs/geometry/doc/html libs/geometry/doc/reference libs/geometry/doc/src libs/geometry/example libs/geometry/test libs/graph/doc libs/graph_parallel libs/icl libs/icl/doc libs/icl/doc/html libs/icl/doc/html/header/boost/icl libs/icl/test libs/icl/test/test_doc_code_ libs/integer libs/interprocess libs/intrusive libs/io libs/io/doc libs/iostreams libs/iterator libs/math libs/math/doc/sf_and_dist libs/math/doc/sf_and_dist/html/math_toolkit/main_overview libs/mpi/build libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/numeric/ublas libs/numeric/ublas/doc libs/parameter/doc/html libs/phoenix/doc libs/phoenix/doc/examples libs/pool libs/program_options libs/program_options/test libs/property_tree libs/python libs/range libs/regex libs/serialization libs/serialization/example libs/serialization/src libs/serialization/test libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/example/qi/compiler_tutorial/mini_c libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/typeof/doc libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave more status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/quickbook/doc tools/quickbook/src tools/quickbook/test tools/regression tools/regression/src tools/release tools/wave
From: hartmut.kaiser_at_[hidden]
Date: 2011-04-28 18:43:35
Author: hkaiser
Date: 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
New Revision: 71576
URL: http://svn.boost.org/trac/boost/changeset/71576
Log:
Spirit: merging from trunk
Added:
branches/release/libs/spirit/test/qi/uint_radix.cpp
- copied unchanged from r71347, /trunk/libs/spirit/test/qi/uint_radix.cpp
branches/release/libs/spirit/test/qi/uint_radix.hpp
- copied unchanged from r71347, /trunk/libs/spirit/test/qi/uint_radix.hpp
Removed:
branches/release/libs/spirit/test/qi/radix_test.cpp
Properties modified:
branches/release/ (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/array.hpp (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/concept_check.hpp (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/config.hpp (props changed)
branches/release/boost/cregex.hpp (props changed)
branches/release/boost/cstdint.hpp (props changed)
branches/release/boost/date_time/c_time.hpp (props changed)
branches/release/boost/date_time/gregorian_calendar.ipp (props changed)
branches/release/boost/date_time/posix_time/time_serialize.hpp (props changed)
branches/release/boost/date_time/strings_from_facet.hpp (props changed)
branches/release/boost/date_time/time_facet.hpp (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/filesystem.hpp (props changed)
branches/release/boost/function/ (props changed)
branches/release/boost/functional/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/fusion/container/list/detail/build_cons.hpp (props changed)
branches/release/boost/geometry/ (props changed)
branches/release/boost/geometry/algorithms/ (props changed)
branches/release/boost/geometry/arithmetic/ (props changed)
branches/release/boost/geometry/core/ (props changed)
branches/release/boost/geometry/domains/ (props changed)
branches/release/boost/geometry/geometries/ (props changed)
branches/release/boost/geometry/geometry.hpp (props changed)
branches/release/boost/geometry/iterators/ (props changed)
branches/release/boost/geometry/multi/ (props changed)
branches/release/boost/geometry/policies/ (props changed)
branches/release/boost/geometry/ranges/ (props changed)
branches/release/boost/geometry/strategies/ (props changed)
branches/release/boost/geometry/util/ (props changed)
branches/release/boost/geometry/views/ (props changed)
branches/release/boost/gil/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/icl/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/integer.hpp (props changed)
branches/release/boost/integer_fwd.hpp (props changed)
branches/release/boost/integer_traits.hpp (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/io/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/iterator/ (props changed)
branches/release/boost/iterator/iterator_facade.hpp (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/math_fwd.hpp (props changed)
branches/release/boost/msm/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/numeric/ublas/functional.hpp (props changed)
branches/release/boost/pool/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/program_options/detail/parsers.hpp (props changed)
branches/release/boost/program_options/parsers.hpp (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/python/ (props changed)
branches/release/boost/range/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/regex.h (props changed)
branches/release/boost/regex.hpp (props changed)
branches/release/boost/regex_fwd.hpp (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/signals2.hpp (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/static_assert.hpp (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/token_functions.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/typeof/message.hpp (props changed)
branches/release/boost/typeof/register_functions.hpp (props changed)
branches/release/boost/typeof/register_functions_iterate.hpp (props changed)
branches/release/boost/typeof/typeof.hpp (props changed)
branches/release/boost/typeof/unsupported.hpp (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/algorithm/string/ (props changed)
branches/release/libs/array/ (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/array/test/array2.cpp (props changed)
branches/release/libs/array/test/array6.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/date_time/ (props changed)
branches/release/libs/date_time/data/date_time_zonespec.csv (props changed)
branches/release/libs/date_time/example/gregorian/days_between_new_years.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_since_year_start.cpp (props changed)
branches/release/libs/date_time/example/gregorian/days_till_new_year.cpp (props changed)
branches/release/libs/date_time/example/gregorian/month_add.cpp (props changed)
branches/release/libs/date_time/example/local_time/flight.cpp (props changed)
branches/release/libs/date_time/example/local_time/local_date_time.cpp (props changed)
branches/release/libs/date_time/example/posix_time/print_hours.cpp (props changed)
branches/release/libs/date_time/example/posix_time/time_math.cpp (props changed)
branches/release/libs/date_time/example/tutorial/io_tutorial.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_facet.cpp (props changed)
branches/release/libs/date_time/test/posix_time/testtime_input_facet.cpp (props changed)
branches/release/libs/date_time/xmldoc/date_class.xml (props changed)
branches/release/libs/date_time/xmldoc/usage_examples.xml (props changed)
branches/release/libs/detail/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/function/ (props changed)
branches/release/libs/functional/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/geometry/ (props changed)
branches/release/libs/geometry/doc/ (props changed)
branches/release/libs/geometry/doc/Jamfile.v2 (props changed)
branches/release/libs/geometry/doc/about_documentation.qbk (props changed)
branches/release/libs/geometry/doc/acknowledgments.qbk (props changed)
branches/release/libs/geometry/doc/concept/ (props changed)
branches/release/libs/geometry/doc/copyright_note_policy.txt (props changed)
branches/release/libs/geometry/doc/design_rationale.qbk (props changed)
branches/release/libs/geometry/doc/doxy/ (props changed)
branches/release/libs/geometry/doc/generated/ (props changed)
branches/release/libs/geometry/doc/geometry.qbk (props changed)
branches/release/libs/geometry/doc/html/ (props changed)
branches/release/libs/geometry/doc/imports.qbk (props changed)
branches/release/libs/geometry/doc/introduction.qbk (props changed)
branches/release/libs/geometry/doc/make_qbk.py (props changed)
branches/release/libs/geometry/doc/matrix.qbk (props changed)
branches/release/libs/geometry/doc/quickref.xml (props changed)
branches/release/libs/geometry/doc/quickstart.qbk (props changed)
branches/release/libs/geometry/doc/readme.txt (props changed)
branches/release/libs/geometry/doc/reference/ (props changed)
branches/release/libs/geometry/doc/reference.qbk (props changed)
branches/release/libs/geometry/doc/src/ (props changed)
branches/release/libs/geometry/example/ (props changed)
branches/release/libs/geometry/index.html (props changed)
branches/release/libs/geometry/test/ (props changed)
branches/release/libs/graph/doc/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/icl/ (props changed)
branches/release/libs/icl/doc/ (props changed)
branches/release/libs/icl/doc/html/ (props changed)
branches/release/libs/icl/doc/html/header/boost/icl/ (props changed)
branches/release/libs/icl/test/ (props changed)
branches/release/libs/icl/test/test_doc_code_/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/io/ (props changed)
branches/release/libs/io/doc/ (props changed)
branches/release/libs/iostreams/ (props changed)
branches/release/libs/iterator/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/math/doc/sf_and_dist/faq.qbk (props changed)
branches/release/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/faq.html (props changed)
branches/release/libs/mpi/build/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/msm/ (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/parameter/doc/html/index.html (props changed)
branches/release/libs/phoenix/doc/basics.qbk (props changed)
branches/release/libs/phoenix/doc/examples/extending_actors.qbk (props changed)
branches/release/libs/phoenix/doc/organisation.qbk (props changed)
branches/release/libs/pool/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/program_options/test/parsers_test.cpp (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/range/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/serialization/example/ (props changed)
branches/release/libs/serialization/src/ (props changed)
branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/typeof/doc/typeof.qbk (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (props changed)
branches/release/libs/utility/assert.html (props changed)
branches/release/libs/utility/assert_test.cpp (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (props changed)
branches/release/status/explicit-failures-markup.xml (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/quickbook/doc/ (props changed)
branches/release/tools/quickbook/src/ (props changed)
branches/release/tools/quickbook/test/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/regression/src/library_status.cpp (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
Text files modified:
branches/release/boost/spirit/home/karma/auto/meta_create.hpp | 24 ++--
branches/release/boost/spirit/home/karma/nonterminal/rule.hpp | 40 +++---
branches/release/boost/spirit/home/qi/nonterminal/rule.hpp | 36 +++---
branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 215 +++++++++++++--------------------------
branches/release/boost/spirit/home/qi/numeric/numeric_utils.hpp | 3
branches/release/boost/spirit/home/qi/numeric/uint.hpp | 11 +
branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp | 4
branches/release/libs/spirit/test/Jamfile | 1
branches/release/libs/spirit/test/qi/uint3.cpp | 8 +
9 files changed, 139 insertions(+), 203 deletions(-)
Modified: branches/release/boost/spirit/home/karma/auto/meta_create.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/auto/meta_create.hpp (original)
+++ branches/release/boost/spirit/home/karma/auto/meta_create.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -52,56 +52,56 @@
struct meta_create_string
{
typedef spirit::standard::string_type type;
- static type const& call() { return spirit::standard::string; }
+ static type const call() { return type(); }
};
template <>
struct meta_create_string<wchar_t*>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <>
struct meta_create_string<wchar_t const*>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <int N>
struct meta_create_string<wchar_t[N]>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <int N>
struct meta_create_string<wchar_t const[N]>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <int N>
struct meta_create_string<wchar_t(&)[N]>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <int N>
struct meta_create_string<wchar_t const(&)[N]>
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
template <typename Traits, typename Allocator>
struct meta_create_string<std::basic_string<wchar_t, Traits, Allocator> >
{
typedef spirit::standard_wide::string_type type;
- static type const& call() { return spirit::standard_wide::string; }
+ static type const call() { return type(); }
};
///////////////////////////////////////////////////////////////////////////
@@ -205,26 +205,26 @@
struct meta_create<char>
{
typedef spirit::standard::char_type type;
- static type const& call() { return spirit::standard::char_; }
+ static type const call() { return type(); }
};
template <>
struct meta_create<signed char>
{
typedef spirit::standard::char_type type;
- static type const& call() { return spirit::standard::char_; }
+ static type const call() { return type(); }
};
template <>
struct meta_create<wchar_t>
{
typedef spirit::standard_wide::char_type type;
- static type const& call() { return spirit::standard_wide::char_; }
+ static type const call() { return type(); }
};
template <>
struct meta_create<unsigned char>
{
typedef spirit::standard::char_type type;
- static type const& call() { return spirit::standard::char_; }
+ static type const call() { return type(); }
};
// boolean generator
Modified: branches/release/boost/spirit/home/karma/nonterminal/rule.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/nonterminal/rule.hpp (original)
+++ branches/release/boost/spirit/home/karma/nonterminal/rule.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -175,20 +175,30 @@
{
}
- template <typename Expr>
- rule (Expr const& expr, std::string const& name_ = "unnamed-rule")
- : base_type(terminal::make(reference_(*this)))
- , name_(name_)
+ template <typename Auto, typename Expr>
+ static void define(rule& lhs, Expr const& expr, mpl::false_)
{
// Report invalid expression error as early as possible.
- // If you got an error_invalid_expression error message here, then
- // the expression (expr) is not a valid spirit karma expression.
+ // If you got an error_invalid_expression error message here,
+ // then the expression (expr) is not a valid spirit karma expression.
BOOST_SPIRIT_ASSERT_MATCH(karma::domain, Expr);
+ }
- f = detail::bind_generator<mpl::false_>(
+ template <typename Auto, typename Expr>
+ static void define(rule& lhs, Expr const& expr, mpl::true_)
+ {
+ lhs.f = detail::bind_generator<Auto>(
compile<karma::domain>(expr, encoding_modifier_type()));
}
+ template <typename Expr>
+ rule (Expr const& expr, std::string const& name_ = "unnamed-rule")
+ : base_type(terminal::make(reference_(*this)))
+ , name_(name_)
+ {
+ define<mpl::false_>(*this, expr, traits::matches<karma::domain, Expr>());
+ }
+
rule& operator=(rule const& rhs)
{
// The following assertion fires when you try to initialize a rule
@@ -215,13 +225,7 @@
template <typename Expr>
rule& operator=(Expr const& expr)
{
- // Report invalid expression error as early as possible.
- // If you got an error_invalid_expression error message here, then
- // the expression (expr) is not a valid spirit karma expression.
- BOOST_SPIRIT_ASSERT_MATCH(karma::domain, Expr);
-
- f = detail::bind_generator<mpl::false_>(
- compile<karma::domain>(expr, encoding_modifier_type()));
+ define<mpl::false_>(*this, expr, traits::matches<karma::domain, Expr>());
return *this;
}
@@ -231,13 +235,7 @@
template <typename Expr>
friend rule& operator%=(rule& r, Expr const& expr)
{
- // Report invalid expression error as early as possible.
- // If you got an error_invalid_expression error message here, then
- // the expression (expr) is not a valid spirit karma expression.
- BOOST_SPIRIT_ASSERT_MATCH(karma::domain, Expr);
-
- r.f = detail::bind_generator<mpl::true_>(
- compile<karma::domain>(expr, encoding_modifier_type()));
+ define<mpl::true_>(r, expr, traits::matches<karma::domain, Expr>());
return r;
}
Modified: branches/release/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ branches/release/boost/spirit/home/qi/nonterminal/rule.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -167,20 +167,30 @@
{
}
- template <typename Expr>
- rule(Expr const& expr, std::string const& name_ = "unnamed-rule")
- : base_type(terminal::make(reference_(*this)))
- , name_(name_)
+ template <typename Auto, typename Expr>
+ static void define(rule& lhs, Expr const& expr, mpl::false_)
{
// Report invalid expression error as early as possible.
// If you got an error_invalid_expression error message here,
// then the expression (expr) is not a valid spirit qi expression.
BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
+ }
- f = detail::bind_parser<mpl::false_>(
+ template <typename Auto, typename Expr>
+ static void define(rule& lhs, Expr const& expr, mpl::true_)
+ {
+ lhs.f = detail::bind_parser<Auto>(
compile<qi::domain>(expr, encoding_modifier_type()));
}
+ template <typename Expr>
+ rule(Expr const& expr, std::string const& name_ = "unnamed-rule")
+ : base_type(terminal::make(reference_(*this)))
+ , name_(name_)
+ {
+ define<mpl::false_>(*this, expr, traits::matches<qi::domain, Expr>());
+ }
+
rule& operator=(rule const& rhs)
{
// The following assertion fires when you try to initialize a rule
@@ -207,13 +217,7 @@
template <typename Expr>
rule& operator=(Expr const& expr)
{
- // Report invalid expression error as early as possible.
- // If you got an error_invalid_expression error message here,
- // then the expression (expr) is not a valid spirit qi expression.
- BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
-
- f = detail::bind_parser<mpl::false_>(
- compile<qi::domain>(expr, encoding_modifier_type()));
+ define<mpl::false_>(*this, expr, traits::matches<qi::domain, Expr>());
return *this;
}
@@ -223,13 +227,7 @@
template <typename Expr>
friend rule& operator%=(rule& r, Expr const& expr)
{
- // Report invalid expression error as early as possible.
- // If you got an error_invalid_expression error message here,
- // then the expression (expr) is not a valid spirit qi expression.
- BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
-
- r.f = detail::bind_parser<mpl::true_>(
- compile<qi::domain>(expr, encoding_modifier_type()));
+ define<mpl::true_>(r, expr, traits::matches<qi::domain, Expr>());
return r;
}
Modified: branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (original)
+++ branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2001-2011 Hartmut Kaiser
+ Copyright (c) 2011 Jan Frederick Eick
+ Copyright (c) 2011 Christopher Jefferson
Copyright (c) 2006 Stephen Nutt
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -18,6 +20,10 @@
#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/char_encoding/ascii.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/comparison/less.hpp>
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_signed.hpp>
@@ -33,6 +39,43 @@
{
///////////////////////////////////////////////////////////////////////////
//
+ // The maximum radix digits that can be represented without
+ // overflow:
+ //
+ // template<typename T, unsigned Radix>
+ // struct digits_traits::value;
+ //
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename T, unsigned Radix>
+ struct digits_traits;
+
+// lookup table for log2(x) : 2 <= x <= 36
+#define BOOST_SPIRIT_LOG2 (#error)(#error) \
+ (1000000)(1584960)(2000000)(2321920)(2584960)(2807350) \
+ (3000000)(3169920)(3321920)(3459430)(3584960)(3700430) \
+ (3807350)(3906890)(4000000)(4087460)(4169920)(4247920) \
+ (4321920)(4392310)(4459430)(4523560)(4584960)(4643850) \
+ (4700430)(4754880)(4807350)(4857980)(4906890)(4954190) \
+ (5000000)(5044390)(5087460)(5129280)(5169925) \
+ /***/
+
+#define BOOST_PP_LOCAL_MACRO(Radix) \
+ template <typename T> struct digits_traits<T, Radix> \
+ { \
+ typedef std::numeric_limits<T> numeric_limits_type; \
+ BOOST_STATIC_CONSTANT(int, value = static_cast<int>( \
+ (numeric_limits_type::digits * 1000000) / \
+ BOOST_PP_SEQ_ELEM(Radix, BOOST_SPIRIT_LOG2))); \
+ }; \
+ /***/
+
+#define BOOST_PP_LOCAL_LIMITS (2, 36)
+#include BOOST_PP_LOCAL_ITERATE()
+
+#undef BOOST_SPIRIT_LOG2
+
+ ///////////////////////////////////////////////////////////////////////////
+ //
// Traits class for radix specific number conversion
//
// Test the validity of a single character:
@@ -44,139 +87,27 @@
//
// template<typename Char> static int digit(Char ch);
//
- // The maximum radix digits that can be represented without
- // overflow:
- //
- // template<typename T> struct digits::value;
- //
///////////////////////////////////////////////////////////////////////////
template <unsigned Radix>
- struct radix_traits;
-
- // Binary
- template <>
- struct radix_traits<2>
- {
- template<typename Char>
- inline static bool is_valid(Char ch)
- {
- return ('0' == ch || '1' == ch);
- }
-
- template<typename Char>
- inline static unsigned digit(Char ch)
- {
- return ch - '0';
- }
-
- template<typename T>
- struct digits
- {
- typedef std::numeric_limits<T> numeric_limits_;
- BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits);
- };
- };
-
- // Octal
- template <>
- struct radix_traits<8>
- {
- template<typename Char>
- inline static bool is_valid(Char ch)
- {
- return ch >= '0' && ch <= '7';
- }
-
- template<typename Char>
- inline static unsigned digit(Char ch)
- {
- return ch - '0';
- }
-
- template<typename T>
- struct digits
- {
- typedef std::numeric_limits<T> numeric_limits_;
- BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits / 3);
- };
- };
-
- // Decimal
- template <>
- struct radix_traits<10>
- {
- template<typename Char>
- inline static bool is_valid(Char ch)
- {
- return ch >= '0' && ch <= '9';
- }
-
- template<typename Char>
- inline static unsigned digit(Char ch)
- {
- return ch - '0';
- }
-
- template<typename T>
- struct digits
- {
- typedef std::numeric_limits<T> numeric_limits_;
- BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits10);
- };
- };
-
- // Hexadecimal
- template <>
- struct radix_traits<16>
+ struct radix_traits
{
- template<typename Char>
+ template <typename Char>
inline static bool is_valid(Char ch)
{
+ if (Radix <= 10)
+ return (ch >= '0' && ch <= static_cast<Char>('0' + Radix -1));
return (ch >= '0' && ch <= '9')
- || (ch >= 'a' && ch <= 'f')
- || (ch >= 'A' && ch <= 'F');
+ || (ch >= 'a' && ch <= static_cast<Char>('a' + Radix -10 -1))
+ || (ch >= 'A' && ch <= static_cast<Char>('A' + Radix -10 -1));
}
- template<typename Char>
+ template <typename Char>
inline static unsigned digit(Char ch)
{
- if (ch >= '0' && ch <= '9')
+ if (Radix <= 10 || (ch >= '0' && ch <= '9'))
return ch - '0';
return spirit::char_encoding::ascii::tolower(ch) - 'a' + 10;
}
-
- template<typename T>
- struct digits
- {
- typedef std::numeric_limits<T> numeric_limits_;
- BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits / 4);
- };
- };
-
- // arbitrary Radix
- template <unsigned Radix>
- struct radix_traits
- {
- template<typename Char>
- inline static bool is_valid(Char ch)
- {
- return (ch >= '0' && ch <= ('0' + Radix - 1));
- }
-
- template<typename Char>
- inline static unsigned digit(Char ch)
- {
- return ch - '0';
- }
-
- template<typename T>
- struct digits
- {
- typedef std::numeric_limits<T> numeric_limits_;
- BOOST_STATIC_CONSTANT(int, value = numeric_limits_::digits10);
- // TODO(j.f.eick_at_[hidden]): this is the min number of digits which
- // can be safely parsed if the radix is < 10 - this is not optimal?
- };
};
///////////////////////////////////////////////////////////////////////////
@@ -199,7 +130,6 @@
{
// Ensure n *= Radix will not overflow
static T const max = (std::numeric_limits<T>::max)();
- //static T const val = (max - 1) / Radix;
static T const val = max / Radix;
if (n > val)
return false;
@@ -258,7 +188,7 @@
call(Char ch, std::size_t count, T& n, mpl::true_)
{
static std::size_t const
- overflow_free = radix_traits<Radix>::template digits<T>::value - 1;
+ overflow_free = digits_traits<T, Radix>::value - 1;
if (count < overflow_free)
{
@@ -295,7 +225,7 @@
return call(ch, count, n
, mpl::bool_<
( (MaxDigits < 0)
- || (MaxDigits > radix_traits<Radix>::template digits<T>::value)
+ || (MaxDigits > digits_traits<T, Radix>::value)
)
&& std::numeric_limits<T>::is_modulo
>()
@@ -331,15 +261,15 @@
///////////////////////////////////////////////////////////////////////////
// extract_int: main code for extracting integers
///////////////////////////////////////////////////////////////////////////
-#define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \
- if (!check_max_digits<MaxDigits>::call(count + leading_zeros) \
- || it == last) \
- break; \
- ch = *it; \
- if (!radix_check::is_valid(ch) || !extractor::call(ch, count, val)) \
- break; \
- ++it; \
- ++count; \
+#define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \
+ if (!check_max_digits<MaxDigits>::call(count + leading_zeros) \
+ || it == last) \
+ break; \
+ ch = *it; \
+ if (!radix_check::is_valid(ch) || !extractor::call(ch, count, val)) \
+ break; \
+ ++it; \
+ ++count; \
/**/
template <
@@ -432,16 +362,16 @@
// extract_int: main code for extracting integers
// common case where MinDigits == 1 and MaxDigits = -1
///////////////////////////////////////////////////////////////////////////
-#define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \
- if (it == last) \
- break; \
- ch = *it; \
- if (!radix_check::is_valid(ch)) \
- break; \
- if (!extractor::call(ch, count, val)) \
- return false; \
- ++it; \
- ++count; \
+#define SPIRIT_NUMERIC_INNER_LOOP(z, x, data) \
+ if (it == last) \
+ break; \
+ ch = *it; \
+ if (!radix_check::is_valid(ch)) \
+ break; \
+ if (!extractor::call(ch, count, val)) \
+ return false; \
+ ++it; \
+ ++count; \
/**/
template <typename T, unsigned Radix, typename Accumulator, bool Accumulate>
@@ -570,7 +500,6 @@
return n;
}
};
-
}}}}
#endif
Modified: branches/release/boost/spirit/home/qi/numeric/numeric_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/numeric/numeric_utils.hpp (original)
+++ branches/release/boost/spirit/home/qi/numeric/numeric_utils.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
+ Copyright (c) 2011 Jan Frederick Eick
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -48,7 +49,7 @@
{
// check template parameter 'Radix' for validity
BOOST_SPIRIT_ASSERT_MSG(
- Radix >= 2 || Radix <= 10 || Radix == 16,
+ Radix >= 2 && Radix <= 36,
not_supported_radix, ());
template <typename Iterator>
Modified: branches/release/boost/spirit/home/qi/numeric/uint.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/numeric/uint.hpp (original)
+++ branches/release/boost/spirit/home/qi/numeric/uint.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -1,6 +1,7 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
- Copyright (c) 2011 Bryce Lelbach
+ Copyright (c) 2011 Bryce Lelbach
+ Copyright (c) 2011 Jan Frederick Eick
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,6 +20,7 @@
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/info.hpp>
+#include <boost/spirit/home/support/detail/is_spirit_tag.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -28,7 +30,10 @@
{
template <typename T, unsigned Radix, unsigned MinDigits
, int MaxDigits>
- struct uint_parser {};
+ struct uint_parser
+ {
+ BOOST_SPIRIT_IS_TAG()
+ };
}
namespace qi
@@ -217,7 +222,7 @@
{
// check template parameter 'Radix' for validity
BOOST_SPIRIT_ASSERT_MSG(
- Radix >= 2 || Radix <= 10 || Radix == 16,
+ Radix >= 2 && Radix <= 36,
not_supported_radix, ());
template <typename Context, typename Iterator>
Modified: branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp
==============================================================================
--- branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp (original)
+++ branches/release/libs/spirit/example/qi/compiler_tutorial/mini_c/compiler.hpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -66,11 +66,11 @@
: current(0)
{
using namespace boost::phoenix::arg_names;
- using boost::phoenix::cref;
+ namespace phx = boost::phoenix;
using boost::phoenix::function;
error_handler = function<ErrorHandler>(error_handler_)(
- "Error! ", _2, cref(error_handler_.iters)[_1]);
+ "Error! ", _2, phx::cref(error_handler_.iters)[_1]);
}
bool operator()(ast::nil) { BOOST_ASSERT(0); return false; }
Modified: branches/release/libs/spirit/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/test/Jamfile (original)
+++ branches/release/libs/spirit/test/Jamfile 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -110,6 +110,7 @@
[ run qi/pass_container2.cpp : : : : qi_pass_container2 ]
[ run qi/permutation.cpp : : : : qi_permutation ]
[ run qi/plus.cpp : : : : qi_plus ]
+ [ run qi/uint_radix.cpp : : : : qi_uint_radix ]
[ run qi/range_run.cpp : : : : qi_range_run ]
[ run qi/raw.cpp : : : : qi_raw ]
[ run qi/real1.cpp : : : : qi_real1 ]
Deleted: branches/release/libs/spirit/test/qi/radix_test.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/radix_test.cpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
+++ (empty file)
@@ -1,187 +0,0 @@
-#include "uint.hpp"
-
-#include <iostream>
-
-int
-main()
-{
- using spirit_test::test;
- using spirit_test::test_attr;
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 3)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 3, 1, -1> base3_parser;
-
- BOOST_TEST(test("210112221200", base3_parser));
- BOOST_TEST(test_attr("210112221200", base3_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("1231", base3_parser));
- BOOST_TEST(!test_attr("1231", base3_parser, u));
-
- char const* max_unsigned_base3 = "102002022201221111210";
- char const* unsigned_overflow_base3 = "102002022201221111211";
- char const* digit_overflow_base3 = "1020020222012211112100";
-
- BOOST_TEST(test(max_unsigned_base3, base3_parser));
- BOOST_TEST(test_attr(max_unsigned_base3, base3_parser, u));
-
- BOOST_TEST(!test(unsigned_overflow_base3, base3_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base3, base3_parser, u));
- BOOST_TEST(!test(digit_overflow_base3, base3_parser));
- BOOST_TEST(!test_attr(digit_overflow_base3, base3_parser, u));
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 4)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 4, 1, -1> base4_parser;
-
- BOOST_TEST(test("1213210302", base4_parser));
- BOOST_TEST(test_attr("1213210302", base4_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("1234", base4_parser));
- BOOST_TEST(!test_attr("1234", base4_parser, u));
-
- char const* max_unsigned_base4 = "3333333333333333";
- char const* unsigned_overflow_base4 = "33333333333333330";
- BOOST_TEST(test(max_unsigned_base4, base4_parser));
- BOOST_TEST(test_attr(max_unsigned_base4, base4_parser, u));
- BOOST_TEST(!test(unsigned_overflow_base4, base4_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base4, base4_parser, u));
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 5)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 5, 1, -1> base5_parser;
-
- BOOST_TEST(test("102033432", base5_parser));
- BOOST_TEST(test_attr("102033432", base5_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("2345", base5_parser));
- BOOST_TEST(!test_attr("2345", base5_parser, u));
-
- char const* max_unsigned_base5 = "32244002423140";
- char const* unsigned_overflow_base5 = "32244002423141";
- char const* digit_overflow_base5 = "322440024231400";
-
- BOOST_TEST(test(max_unsigned_base5, base5_parser));
- BOOST_TEST(test_attr(max_unsigned_base5, base5_parser, u));
-
- BOOST_TEST(!test(unsigned_overflow_base5, base5_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base5, base5_parser, u));
- BOOST_TEST(!test(digit_overflow_base5, base5_parser));
- BOOST_TEST(!test_attr(digit_overflow_base5, base5_parser, u));
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 6)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 6, 1, -1> base6_parser;
-
- BOOST_TEST(test("13032030", base6_parser));
- BOOST_TEST(test_attr("13032030", base6_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("3456", base6_parser));
- BOOST_TEST(!test_attr("3456", base6_parser, u));
-
- char const* max_unsigned_base6 = "1550104015503";
- char const* unsigned_overflow_base6 = "1550104015504";
- char const* digit_overflow_base6 = "15501040155030";
-
- BOOST_TEST(test(max_unsigned_base6, base6_parser));
- BOOST_TEST(test_attr(max_unsigned_base6, base6_parser, u));
-
- BOOST_TEST(!test(unsigned_overflow_base6, base6_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base6, base6_parser, u));
- BOOST_TEST(!test(digit_overflow_base6, base6_parser));
- BOOST_TEST(!test_attr(digit_overflow_base6, base6_parser, u));
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 7)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 7, 1, -1> base7_parser;
-
- BOOST_TEST(test("3414600", base7_parser));
- BOOST_TEST(test_attr("3414600", base7_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("4567", base7_parser));
- BOOST_TEST(!test_attr("4567", base7_parser, u));
-
- char const* max_unsigned_base7 = "211301422353";
- char const* unsigned_overflow_base7 = "211301422354";
- char const* digit_overflow_base7 = "2113014223530";
-
- BOOST_TEST(test(max_unsigned_base7, base7_parser));
- BOOST_TEST(test_attr(max_unsigned_base7, base7_parser, u));
-
- BOOST_TEST(!test(unsigned_overflow_base7, base7_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base7, base7_parser, u));
- BOOST_TEST(!test(digit_overflow_base7, base7_parser));
- BOOST_TEST(!test_attr(digit_overflow_base7, base7_parser, u));
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // arbitrary radix test (base 7)
- ///////////////////////////////////////////////////////////////////////////
- {
- using boost::spirit::qi::uint_;
- using boost::spirit::qi::uint_parser;
- unsigned int u;
-
- uint_parser<unsigned int, 9, 1, -1> base9_parser;
-
- BOOST_TEST(test("715850", base9_parser));
- BOOST_TEST(test_attr("715850", base9_parser, u));
- BOOST_TEST(424242 == u);
-
- BOOST_TEST(!test("6789", base9_parser));
- BOOST_TEST(!test_attr("6789", base9_parser, u));
-
- char const* max_unsigned_base9 = "12068657453";
- char const* unsigned_overflow_base9 = "12068657454";
- char const* digit_overflow_base9 = "120686574530";
-
- BOOST_TEST(test(max_unsigned_base9, base9_parser));
- BOOST_TEST(test_attr(max_unsigned_base9, base9_parser, u));
-
- BOOST_TEST(!test(unsigned_overflow_base9, base9_parser));
- BOOST_TEST(!test_attr(unsigned_overflow_base9, base9_parser, u));
- BOOST_TEST(!test(digit_overflow_base9, base9_parser));
- BOOST_TEST(!test_attr(digit_overflow_base9, base9_parser, u));
- }
-
- return boost::report_errors();
-}
Modified: branches/release/libs/spirit/test/qi/uint3.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/uint3.cpp (original)
+++ branches/release/libs/spirit/test/qi/uint3.cpp 2011-04-28 18:43:33 EDT (Thu, 28 Apr 2011)
@@ -58,10 +58,14 @@
unsigned u;
BOOST_TEST(test("12545674515", oct(012545674515)));
+#if UINT_MAX > 4294967296 // > 32 bits only
BOOST_TEST(!test("12545674515", oct(051547654521)));
+#endif
BOOST_TEST(test_attr("12545674515", oct(012545674515), u));
BOOST_TEST(u == 012545674515);
+#if UINT_MAX > 4294967296 // > 32 bits only
BOOST_TEST(!test_attr("12545674515", oct(051547654521), u));
+#endif
BOOST_TEST(test(max_octal, oct(UINT_MAX)));
BOOST_TEST(test_attr(max_octal, oct(UINT_MAX), u));
@@ -105,7 +109,7 @@
BOOST_TEST(test("123", uint_(123)[ref(n) = _1]));
BOOST_TEST(n == 123);
BOOST_TEST(!test("123", uint_(321)[ref(n) = _1]));
-
+
BOOST_TEST(test_attr("789", uint_(789)[ref(n) = _1], m));
BOOST_TEST(n == 789 && m == 789);
BOOST_TEST(!test_attr("789", uint_(987)[ref(n) = _1], m));
@@ -114,7 +118,7 @@
BOOST_TEST(n == 456);
BOOST_TEST(!test(" 456", uint_(654)[ref(n) = _1], space));
}
-
+
///////////////////////////////////////////////////////////////////////////
// parameterized lazy tests
///////////////////////////////////////////////////////////////////////////
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