Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63620 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/detail boost/filesystem boost/fusion boost/gil boost/graph boost/integer boost/interprocess boost/intrusive boost/msm boost/numeric/ublas boost/program_options boost/property_tree boost/python boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/qi boost/spirit/home/support boost/system boost/thread boost/utility boost/uuid boost/variant boost/wave libs libs/array/test libs/bimap libs/filesystem libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/numeric/ublas libs/numeric/ublas/doc libs/property_tree libs/python libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/example/scheme libs/spirit/example/scheme/detail libs/spirit/example/scheme/input libs/spirit/example/scheme/output libs/spirit/example/scheme/test libs/spirit/example/scheme/test/parse_qiexpr libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/static_assert libs/system libs/thread libs/timer libs/utility libs/utility/swap/test libs/uuid libs/wave status tools tools/bcp tools/jam tools/regression tools/release tools/wave
From: hartmut.kaiser_at_[hidden]
Date: 2010-07-04 14:45:59


Author: hkaiser
Date: 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
New Revision: 63620
URL: http://svn.boost.org/trac/boost/changeset/63620

Log:
Spirit: merging from trunk upto rev. 61194
Added:
   branches/release/libs/spirit/example/scheme/input/parse_qiexpr.hpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/input/parse_qiexpr.hpp
   branches/release/libs/spirit/example/scheme/input/parse_qiexpr_impl.hpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/input/parse_qiexpr_impl.hpp
   branches/release/libs/spirit/example/scheme/input/qiexpr.hpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/input/qiexpr.hpp
   branches/release/libs/spirit/example/scheme/input/string.hpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/input/string.hpp
   branches/release/libs/spirit/example/scheme/scheme_compiler.hpp
      - copied, changed from r61190, /trunk/libs/spirit/example/scheme/scheme_compiler.hpp
   branches/release/libs/spirit/example/scheme/scheme_interpreter.hpp
      - copied, changed from r61190, /trunk/libs/spirit/example/scheme/scheme_interpreter.hpp
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/
      - copied from r61156, /trunk/libs/spirit/example/scheme/test/parse_qiexpr/
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/generate_sexpr_to_ostream.cpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/test/parse_qiexpr/generate_sexpr_to_ostream.cpp
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/input.txt
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/test/parse_qiexpr/input.txt
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/parse_qi_test.cpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qi_test.cpp
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/parse_qiexpr.cpp
      - copied unchanged from r61156, /trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qiexpr.cpp
   branches/release/libs/spirit/example/scheme/test/scheme_test.scm
      - copied unchanged from r61174, /trunk/libs/spirit/example/scheme/test/scheme_test.scm
Properties modified:
   branches/release/ (props changed)
   branches/release/INSTALL (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/bimap/ (props changed)
   branches/release/boost/detail/ (props changed)
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/fusion/ (props changed)
   branches/release/boost/gil/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/integer/ (props changed)
   branches/release/boost/interprocess/ (props changed)
   branches/release/boost/intrusive/ (props changed)
   branches/release/boost/msm/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/property_tree/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/serialization/factory.hpp (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2/ (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/system/ (props changed)
   branches/release/boost/thread/ (props changed)
   branches/release/boost/thread.hpp (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/wave/ (props changed)
   branches/release/bootstrap.bat (props changed)
   branches/release/bootstrap.sh (props changed)
   branches/release/index.htm (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/array/test/array0.cpp (props changed)
   branches/release/libs/bimap/ (props changed)
   branches/release/libs/filesystem/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/integer/ (props changed)
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (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/property_tree/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/serialization/ (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/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/utility/ (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/rst.css (props changed)
   branches/release/status/ (props changed)
   branches/release/status/Jamfile.v2 (props changed)
   branches/release/tools/ (props changed)
   branches/release/tools/bcp/ (props changed)
   branches/release/tools/jam/ (props changed)
   branches/release/tools/regression/ (props changed)
   branches/release/tools/release/ (props changed)
   branches/release/tools/wave/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/karma/generate.hpp | 75 +++++++++++++++++++++++++--
   branches/release/boost/spirit/home/karma/generate_attr.hpp | 54 ++++++++++++++++++--
   branches/release/boost/spirit/home/qi/parse.hpp | 74 ++++++++++++++++++++++++++-
   branches/release/boost/spirit/home/qi/parse_attr.hpp | 34 ++++++++++++
   branches/release/libs/spirit/example/scheme/detail/utree_detail2.hpp | 33 ++++++++---
   branches/release/libs/spirit/example/scheme/detail/utree_detail3.hpp | 6 +
   branches/release/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp | 4
   branches/release/libs/spirit/example/scheme/input/sexpr.hpp | 80 +----------------------------
   branches/release/libs/spirit/example/scheme/output/sexpr.hpp | 4 +
   branches/release/libs/spirit/example/scheme/scheme_compiler.hpp | 28 ++++-----
   branches/release/libs/spirit/example/scheme/scheme_interpreter.hpp | 20 +++---
   branches/release/libs/spirit/example/scheme/test/scheme.cpp | 105 +++++++++------------------------------
   branches/release/libs/spirit/example/scheme/test/sexpr_input_test.cpp | 2
   branches/release/libs/spirit/example/scheme/test/sexpr_output_test.cpp | 4
   branches/release/libs/spirit/example/scheme/test/utree_test.cpp | 96 +++++++++++++++++++----------------
   15 files changed, 361 insertions(+), 258 deletions(-)

Modified: branches/release/boost/spirit/home/karma/generate.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/generate.hpp (original)
+++ branches/release/boost/spirit/home/karma/generate.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -24,11 +24,21 @@
         return detail::generate_impl<Expr>::call(sink, expr);
     }
 
+ template <typename OutputIterator, typename Expr>
+ inline bool
+ generate(
+ OutputIterator const& sink_
+ , Expr const& expr)
+ {
+ OutputIterator sink = sink_;
+ return generate(sink, expr);
+ }
+
     ///////////////////////////////////////////////////////////////////////////
     template <typename OutputIterator, typename Expr, typename Attr>
     inline bool
     generate(
- OutputIterator& target_sink
+ OutputIterator& sink_
       , Expr const& expr
       , Attr const& attr)
     {
@@ -43,7 +53,7 @@
 
         // wrap user supplied iterator into our own output iterator
         detail::output_iterator<OutputIterator
- , mpl::int_<properties::value> > sink(target_sink);
+ , mpl::int_<properties::value> > sink(sink_);
         return compile<karma::domain>(expr).generate(sink, unused, unused, attr);
     }
 
@@ -63,6 +73,17 @@
         return compile<karma::domain>(expr).generate(sink, unused, unused, attr);
     }
 
+ template <typename OutputIterator, typename Expr, typename Attr>
+ inline bool
+ generate(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Attr const& attr)
+ {
+ OutputIterator sink = sink_;
+ return generate(sink, expr, attr);
+ }
+
     ///////////////////////////////////////////////////////////////////////////
     template <typename OutputIterator, typename Expr, typename Delimiter>
     inline bool
@@ -77,6 +98,19 @@
             sink, expr, delimiter, pre_delimit);
     }
 
+ template <typename OutputIterator, typename Expr, typename Delimiter>
+ inline bool
+ generate_delimited(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Delimiter const& delimiter
+ , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit =
+ delimit_flag::dont_predelimit)
+ {
+ OutputIterator sink = sink_;
+ return generate_delimited(sink, expr, delimiter, pre_delimit);
+ }
+
     ///////////////////////////////////////////////////////////////////////////
     template <typename OutputIterator, typename Properties, typename Expr
       , typename Delimiter, typename Attribute>
@@ -107,12 +141,11 @@
             generate(sink, unused, delimiter_, attr);
     }
 
- ///////////////////////////////////////////////////////////////////////////
     template <typename OutputIterator, typename Expr, typename Delimiter
       , typename Attribute>
     inline bool
     generate_delimited(
- OutputIterator& target_sink
+ OutputIterator& sink_
       , Expr const& expr
       , Delimiter const& delimiter
       , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit
@@ -128,13 +161,27 @@
         // wrap user supplied iterator into our own output iterator
         detail::output_iterator<OutputIterator
           , mpl::int_<properties::value | delimiter_properties::value>
- > sink(target_sink);
+ > sink(sink_);
         return karma::generate_delimited(sink, expr, delimiter, pre_delimit, attr);
     }
 
+ template <typename OutputIterator, typename Expr, typename Delimiter
+ , typename Attribute>
+ inline bool
+ generate_delimited(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Delimiter const& delimiter
+ , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit
+ , Attribute const& attr)
+ {
+ OutputIterator sink = sink_;
+ return generate_delimited(sink, expr, delimiter, pre_delimit, attr);
+ }
+
     ///////////////////////////////////////////////////////////////////////////
- template <typename OutputIterator, typename Expr, typename Attribute
- , typename Delimiter>
+ template <typename OutputIterator, typename Expr, typename Delimiter
+ , typename Attribute>
     inline bool
     generate_delimited(
         OutputIterator& sink
@@ -146,6 +193,20 @@
           , delimit_flag::dont_predelimit, attr);
     }
 
+ template <typename OutputIterator, typename Expr, typename Delimiter
+ , typename Attribute>
+ inline bool
+ generate_delimited(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Delimiter const& delimiter
+ , Attribute const& attr)
+ {
+ OutputIterator sink = sink_;
+ return karma::generate_delimited(sink, expr, delimiter
+ , delimit_flag::dont_predelimit, attr);
+ }
+
 }}}
 
 #endif

Modified: branches/release/boost/spirit/home/karma/generate_attr.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/generate_attr.hpp (original)
+++ branches/release/boost/spirit/home/karma/generate_attr.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -62,7 +62,7 @@
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
     inline bool
     generate(
- OutputIterator& target_sink
+ OutputIterator& sink_
       , Expr const& expr
       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
     {
@@ -72,7 +72,19 @@
 
         // wrap user supplied iterator into our own output iterator
         detail::output_iterator<OutputIterator
- , mpl::int_<properties::value> > sink(target_sink);
+ , mpl::int_<properties::value> > sink(sink_);
+ return karma::generate(sink, expr, BOOST_PP_ENUM_PARAMS(N, attr));
+ }
+
+ template <typename OutputIterator, typename Expr
+ , BOOST_PP_ENUM_PARAMS(N, typename A)>
+ inline bool
+ generate(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
+ {
+ OutputIterator sink = sink_;
         return karma::generate(sink, expr, BOOST_PP_ENUM_PARAMS(N, attr));
     }
 
@@ -116,7 +128,7 @@
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
     inline bool
     generate_delimited(
- OutputIterator& target_sink
+ OutputIterator& sink_
       , Expr const& expr
       , Delimiter const& delimiter
       , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit
@@ -132,16 +144,32 @@
         // wrap user supplied iterator into our own output iterator
         detail::output_iterator<OutputIterator
           , mpl::int_<properties::value | delimiter_properties::value>
- > sink(target_sink);
+ > sink(sink_);
+ return karma::generate_delimited(sink, expr, delimiter, pre_delimit
+ , BOOST_PP_ENUM_PARAMS(N, attr));
+ }
+
+ template <typename OutputIterator, typename Expr, typename Delimiter
+ , BOOST_PP_ENUM_PARAMS(N, typename A)>
+ inline bool
+ generate_delimited(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Delimiter const& delimiter
+ , BOOST_SCOPED_ENUM(delimit_flag) pre_delimit
+ , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
+ {
+ OutputIterator sink = sink_;
         return karma::generate_delimited(sink, expr, delimiter, pre_delimit
           , BOOST_PP_ENUM_PARAMS(N, attr));
     }
 
+ ///////////////////////////////////////////////////////////////////////////
     template <typename OutputIterator, typename Expr, typename Delimiter
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
     inline bool
     generate_delimited(
- OutputIterator& target_sink
+ OutputIterator& sink_
       , Expr const& expr
       , Delimiter const& delimiter
       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
@@ -156,11 +184,25 @@
         // wrap user supplied iterator into our own output iterator
         detail::output_iterator<OutputIterator
           , mpl::int_<properties::value | delimiter_properties::value>
- > sink(target_sink);
+ > sink(sink_);
         return karma::generate_delimited(sink, expr, delimiter
           , delimit_flag::dont_predelimit, BOOST_PP_ENUM_PARAMS(N, attr));
     }
 
+ template <typename OutputIterator, typename Expr, typename Delimiter
+ , BOOST_PP_ENUM_PARAMS(N, typename A)>
+ inline bool
+ generate_delimited(
+ OutputIterator const& sink_
+ , Expr const& expr
+ , Delimiter const& delimiter
+ , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
+ {
+ OutputIterator sink = sink_;
+ return karma::generate_delimited(sink, expr, delimiter,
+ , delimit_flag::dont_predelimit, BOOST_PP_ENUM_PARAMS(N, attr));
+ }
+
 }}}
 
 #undef BOOST_SPIRIT_KARMA_ATTRIBUTE_REFERENCE

Modified: branches/release/boost/spirit/home/qi/parse.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/parse.hpp (original)
+++ branches/release/boost/spirit/home/qi/parse.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -25,7 +25,7 @@
       , Iterator last
       , Expr const& expr)
     {
- // Make sure the iterator is at least a forward_iterator. If you got an
+ // Make sure the iterator is at least a forward_iterator. If you got a
         // compilation error here, then you are using an input_iterator while
         // calling this function, you need to supply at least a
         // forward_iterator instead.
@@ -34,6 +34,18 @@
         return detail::parse_impl<Expr>::call(first, last, expr);
     }
 
+ template <typename Iterator, typename Expr>
+ inline bool
+ parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr)
+ {
+ Iterator first = first_;
+ return parse(first, last, expr);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Iterator, typename Expr, typename Attr>
     inline bool
     parse(
@@ -42,7 +54,7 @@
       , Expr const& expr
       , Attr& attr)
     {
- // Make sure the iterator is at least a forward_iterator. If you got an
+ // Make sure the iterator is at least a forward_iterator. If you got a
         // compilation error here, then you are using an input_iterator while
         // calling this function, you need to supply at least a
         // forward_iterator instead.
@@ -56,6 +68,18 @@
         return compile<qi::domain>(expr).parse(first, last, unused, unused, attr);
     }
 
+ template <typename Iterator, typename Expr, typename Attr>
+ inline bool
+ parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , Attr& attr)
+ {
+ Iterator first = first_;
+ return parse(first, last, expr, attr);
+ }
+
     ///////////////////////////////////////////////////////////////////////////
     template <typename Iterator, typename Expr, typename Skipper>
     inline bool
@@ -66,7 +90,7 @@
       , Skipper const& skipper
       , BOOST_SCOPED_ENUM(skip_flag) post_skip = skip_flag::postskip)
     {
- // Make sure the iterator is at least a forward_iterator. If you got an
+ // Make sure the iterator is at least a forward_iterator. If you got a
         // compilation error here, then you are using an input_iterator while
         // calling this function, you need to supply at least a
         // forward_iterator instead.
@@ -76,6 +100,20 @@
             first, last, expr, skipper, post_skip);
     }
 
+ template <typename Iterator, typename Expr, typename Skipper>
+ inline bool
+ phrase_parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , Skipper const& skipper
+ , BOOST_SCOPED_ENUM(skip_flag) post_skip = skip_flag::postskip)
+ {
+ Iterator first = first_;
+ return phrase_parse(first, last, expr, skipper, post_skip);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Iterator, typename Expr, typename Skipper, typename Attr>
     inline bool
     phrase_parse(
@@ -86,7 +124,7 @@
       , BOOST_SCOPED_ENUM(skip_flag) post_skip
       , Attr& attr)
     {
- // Make sure the iterator is at least a forward_iterator. If you got an
+ // Make sure the iterator is at least a forward_iterator. If you got a
         // compilation error here, then you are using an input_iterator while
         // calling this function, you need to supply at least a
         // forward_iterator instead.
@@ -116,6 +154,21 @@
     template <typename Iterator, typename Expr, typename Skipper, typename Attr>
     inline bool
     phrase_parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , Skipper const& skipper
+ , BOOST_SCOPED_ENUM(skip_flag) post_skip
+ , Attr& attr)
+ {
+ Iterator first = first_;
+ return phrase_parse(first, last, expr, skipper, post_skip, attr);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Iterator, typename Expr, typename Skipper, typename Attr>
+ inline bool
+ phrase_parse(
         Iterator& first
       , Iterator last
       , Expr const& expr
@@ -125,6 +178,19 @@
         return phrase_parse(first, last, expr, skipper, skip_flag::postskip, attr);
     }
 
+ template <typename Iterator, typename Expr, typename Skipper, typename Attr>
+ inline bool
+ phrase_parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , Skipper const& skipper
+ , Attr& attr)
+ {
+ Iterator first = first_;
+ return phrase_parse(first, last, expr, skipper, skip_flag::postskip, attr);
+ }
+
 }}}
 
 #endif

Modified: branches/release/boost/spirit/home/qi/parse_attr.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/parse_attr.hpp (original)
+++ branches/release/boost/spirit/home/qi/parse_attr.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -37,6 +37,7 @@
 
 namespace boost { namespace spirit { namespace qi
 {
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Iterator, typename Expr
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
     inline bool
@@ -65,6 +66,19 @@
         return compile<qi::domain>(expr).parse(first, last, unused, unused, attr);
     }
 
+ template <typename Iterator, typename Expr
+ , BOOST_PP_ENUM_PARAMS(N, typename A)>
+ inline bool
+ parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
+ {
+ Iterator first = first_;
+ return qi::parse(first, last, expr, BOOST_PP_ENUM_PARAMS(N, attr));
+ }
+
     ///////////////////////////////////////////////////////////////////////////
     template <typename Iterator, typename Expr, typename Skipper
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
@@ -113,13 +127,30 @@
       , BOOST_PP_ENUM_PARAMS(N, typename A)>
     inline bool
     phrase_parse(
+ Iterator const& first_
+ , Iterator last
+ , Expr const& expr
+ , Skipper const& skipper
+ , BOOST_SCOPED_ENUM(skip_flag) post_skip
+ , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
+ {
+ Iterator first = first_;
+ return qi::phrase_parse(first, last, expr, skipper, post_skip
+ , BOOST_PP_ENUM_PARAMS(N, attr));
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Iterator, typename Expr, typename Skipper
+ , BOOST_PP_ENUM_PARAMS(N, typename A)>
+ inline bool
+ phrase_parse(
         Iterator& first
       , Iterator last
       , Expr const& expr
       , Skipper const& skipper
       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
     {
- return phrase_parse(first, last, expr, skipper, skip_flag::postskip
+ return qi::phrase_parse(first, last, expr, skipper, skip_flag::postskip
           , BOOST_PP_ENUM_PARAMS(N, attr));
     }
 
@@ -137,6 +168,7 @@
         return qi::phrase_parse(first, last, expr, skipper, skip_flag::postskip
           , BOOST_PP_ENUM_PARAMS(N, attr));
     }
+
 }}}
 
 #undef BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE

Modified: branches/release/libs/spirit/example/scheme/detail/utree_detail2.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/detail/utree_detail2.hpp (original)
+++ branches/release/libs/spirit/example/scheme/detail/utree_detail2.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -127,8 +127,11 @@
         node_iterator()
           : node(0) {}
 
- explicit node_iterator(list::node* p)
- : node(p) {}
+ explicit node_iterator(list::node* node)
+ : node(node), prev(node->prev) {}
+
+ node_iterator(list::node* node, list::node* prev)
+ : node(node), prev(prev) {}
 
     private:
 
@@ -137,12 +140,20 @@
 
         void increment()
         {
- node = node->next;
+ if (node != 0) // not at end
+ {
+ prev = node;
+ node = node->next;
+ }
         }
 
         void decrement()
         {
- node = node->prev;
+ if (prev != 0) // not at begin
+ {
+ node = prev;
+ prev = prev->prev;
+ }
         }
 
         bool equal(node_iterator const& other) const
@@ -156,6 +167,7 @@
         }
 
         list::node* node;
+ list::node* prev;
     };
 
     inline void list::free()
@@ -350,7 +362,7 @@
                     return f(x.d);
 
                 case type::list_type:
- return f(list_range(iterator(x.l.first), iterator(0)));
+ return f(list_range(iterator(x.l.first), iterator(0, x.l.last)));
 
                 case type::string_type:
                     return f(utf8_string_range(x.s.str(), x.s.size()));
@@ -403,7 +415,7 @@
                 case type::list_type:
                     return visit_impl::apply(
                         y, detail::bind<F, list_range>(f,
- list_range(iterator(x.l.first), iterator(0))));
+ list_range(iterator(x.l.first), iterator(0, x.l.last))));
 
                 case type::string_type:
                     return visit_impl::apply(y, detail::bind(
@@ -683,7 +695,7 @@
         if (get_type() == type::reference_type)
             return p->insert(pos, val);
         ensure_list_type();
- if (pos.node == l.last)
+ if (pos == end())
         {
             push_back(val);
             return begin();
@@ -756,7 +768,8 @@
         if (get_type() == type::reference_type)
             return p->erase(pos);
         BOOST_ASSERT(get_type() == type::list_type);
- return iterator(l.erase(pos.node));
+ detail::list::node* np = l.erase(pos.node);
+ return iterator(np, np?np->prev:l.last);
     }
 
     inline utree::iterator utree::erase(iterator first, iterator last)
@@ -781,7 +794,7 @@
         if (get_type() == type::reference_type)
             return p->end();
         ensure_list_type();
- return iterator(l.last);
+ return iterator(0, l.last);
     }
 
     inline utree::const_iterator utree::begin() const
@@ -797,7 +810,7 @@
         if (get_type() == type::reference_type)
             return ((utree const*)p)->end();
         BOOST_ASSERT(get_type() == type::list_type);
- return const_iterator(l.last);
+ return const_iterator(0, l.last);
     }
 
     inline bool utree::empty() const

Modified: branches/release/libs/spirit/example/scheme/detail/utree_detail3.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/detail/utree_detail3.hpp (original)
+++ branches/release/libs/spirit/example/scheme/detail/utree_detail3.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -73,7 +73,8 @@
             typedef boost::iterator_range<utree::iterator> type;
             static type call(utree const& x)
             {
- return type(utree::iterator(x.l.first), utree::iterator(0));
+ return type(utree::iterator(x.l.first)
+ , utree::iterator(0, x.l.last));
             }
         };
 
@@ -83,7 +84,8 @@
             typedef boost::iterator_range<utree::const_iterator> type;
             static type call(utree const& x)
             {
- return type(utree::const_iterator(x.l.first), utree::const_iterator(0));
+ return type(utree::const_iterator(x.l.first)
+ , utree::const_iterator(0, x.l.last));
             }
         };
 

Modified: branches/release/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp (original)
+++ branches/release/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -27,7 +27,7 @@
         iterator_type last;
 
         scheme::input::sexpr<iterator_type> p;
- scheme::input::white_space<iterator_type> ws;
+ scheme::input::sexpr_white_space<iterator_type> ws;
 
         return phrase_parse(first, last, p, ws, result);
     }
@@ -44,7 +44,7 @@
         iterator_type last;
 
         scheme::input::sexpr<iterator_type> p;
- scheme::input::white_space<iterator_type> ws;
+ scheme::input::sexpr_white_space<iterator_type> ws;
 
         return phrase_parse(first, last, +p, ws, result);
     }

Modified: branches/release/libs/spirit/example/scheme/input/sexpr.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/input/sexpr.hpp (original)
+++ branches/release/libs/spirit/example/scheme/input/sexpr.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -18,6 +18,7 @@
 #include <boost/regex/pending/unicode_iterator.hpp>
 
 #include "../utree.hpp"
+#include "string.hpp"
 
 namespace scheme { namespace input
 {
@@ -26,28 +27,23 @@
     using boost::spirit::qi::grammar;
     using boost::spirit::qi::rule;
     using boost::spirit::qi::eol;
- using boost::spirit::qi::_val;
- using boost::spirit::qi::_r1;
- using boost::spirit::qi::_1;
     using boost::spirit::qi::uint_parser;
     using boost::spirit::qi::real_parser;
     using boost::spirit::qi::strict_real_policies;
- using boost::spirit::qi::char_set;
     using boost::spirit::qi::int_;
     using boost::spirit::qi::hex;
     using boost::spirit::qi::oct;
     using boost::spirit::qi::bool_;
     using boost::spirit::qi::no_case;
     using boost::spirit::qi::lexeme;
- using boost::spirit::qi::lit;
     using boost::phoenix::function;
 
     typedef boost::uint32_t uchar; // a unicode code point
 
     template <typename Iterator>
- struct white_space : grammar<Iterator>
+ struct sexpr_white_space : grammar<Iterator>
     {
- white_space() : white_space::base_type(start)
+ sexpr_white_space() : sexpr_white_space::base_type(start)
         {
             start =
                     space // tab/space/cr/lf
@@ -58,74 +54,8 @@
         rule<Iterator> start;
     };
 
- namespace detail
- {
- struct push_utf8
- {
- template <typename S, typename C>
- struct result { typedef void type; };
-
- void operator()(std::string& utf8, uchar code_point) const
- {
- typedef std::back_insert_iterator<std::string> insert_iter;
- insert_iter out_iter(utf8);
- boost::utf8_output_iterator<insert_iter> utf8_iter(out_iter);
- *utf8_iter++ = code_point;
- }
- };
-
- struct push_esc
- {
- template <typename S, typename C>
- struct result { typedef void type; };
-
- void operator()(std::string& utf8, uchar c) const
- {
- switch (c)
- {
- case 'b': utf8 += '\b'; break;
- case 't': utf8 += '\t'; break;
- case 'n': utf8 += '\n'; break;
- case 'f': utf8 += '\f'; break;
- case 'r': utf8 += '\r'; break;
- case '"': utf8 += '"'; break;
- case '\\': utf8 += '\\'; break;
- }
- }
- };
- }
-
- template <typename Iterator>
- struct string : grammar<Iterator, std::string()>
- {
- string() : string::base_type(start)
- {
- uint_parser<uchar, 16, 4, 4> hex4;
- uint_parser<uchar, 16, 8, 8> hex8;
- function<detail::push_utf8> push_utf8;
- function<detail::push_esc> push_esc;
-
- str_esc
- = '\\'
- >> ( ('u' >> hex4) [push_utf8(_r1, _1)]
- | ('U' >> hex8) [push_utf8(_r1, _1)]
- | char_("btnfr\\\"'") [push_esc(_r1, _1)]
- )
- ;
-
- start
- = '"'
- >> *(str_esc(_val) | (~char_('"')) [_val += _1])
- >> '"'
- ;
- }
-
- rule<Iterator, void(std::string&)> str_esc;
- rule<Iterator, std::string()> start;
- };
-
     template <typename Iterator>
- struct sexpr : grammar<Iterator, white_space<Iterator>, utree()>
+ struct sexpr : grammar<Iterator, sexpr_white_space<Iterator>, utree()>
     {
         sexpr() : sexpr::base_type(start)
         {
@@ -155,7 +85,7 @@
             byte_str = lexeme[no_case['b'] >> +hex2];
         }
 
- rule<Iterator, white_space<Iterator>, utree()> start, list;
+ rule<Iterator, sexpr_white_space<Iterator>, utree()> start, list;
         rule<Iterator, int()> integer;
         rule<Iterator, utree()> atom;
         rule<Iterator, utf8_symbol()> symbol;

Modified: branches/release/libs/spirit/example/scheme/output/sexpr.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/output/sexpr.hpp (original)
+++ branches/release/libs/spirit/example/scheme/output/sexpr.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -144,6 +144,7 @@
     using boost::spirit::karma::int_;
     using boost::spirit::karma::char_;
     using boost::spirit::karma::bool_;
+ using boost::spirit::karma::eps;
     using boost::spirit::karma::space_type;
     using boost::spirit::karma::uint_generator;
 
@@ -163,6 +164,7 @@
                       | symbol
                       | byte_str
                       | list
+ | nil_
                       ;
 
             list = '(' << *start << ')';
@@ -170,6 +172,7 @@
             string = '"' << *char_ << '"';
             symbol = *char_;
             byte_str = 'b' << *hex2;
+ nil_ = eps;
         }
 
         typedef boost::iterator_range<utree::const_iterator> utree_list;
@@ -179,6 +182,7 @@
         rule<OutputIterator, utf8_symbol_range()> symbol;
         rule<OutputIterator, utf8_string_range()> string;
         rule<OutputIterator, binary_range()> byte_str;
+ rule<OutputIterator, nil()> nil_;
     };
 }}
 

Copied: branches/release/libs/spirit/example/scheme/scheme_compiler.hpp (from r61190, /trunk/libs/spirit/example/scheme/scheme_compiler.hpp)
==============================================================================
--- /trunk/libs/spirit/example/scheme/scheme_compiler.hpp (original)
+++ branches/release/libs/spirit/example/scheme/scheme_compiler.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -25,13 +25,11 @@
 ///////////////////////////////////////////////////////////////////////////////
 // The compiler
 ///////////////////////////////////////////////////////////////////////////////
- typedef boost::function<function(function_list&)> function_compiler;
-
- class compiler_environment
+ class environment
     {
     public:
 
- compiler_environment(compiler_environment* parent = 0)
+ environment(environment* parent = 0)
           : outer(parent) {}
 
         void define(std::string const& name, function_compiler const& def)
@@ -52,22 +50,22 @@
             return 0;
         }
 
- compiler_environment* parent() const { return outer; }
+ environment* parent() const { return outer; }
 
     private:
 
- compiler_environment* outer;
+ environment* outer;
         std::map<std::string, function_compiler> definitions;
     };
 
- function compile(utree const& ast, compiler_environment& env);
+ actor compile(utree const& ast, environment& env);
 
     struct compiler
     {
         typedef function result_type;
 
- mutable compiler_environment& env;
- compiler(compiler_environment& env)
+ mutable environment& env;
+ compiler(environment& env)
           : env(env)
         {
         }
@@ -101,11 +99,11 @@
             std::vector<std::string> const& args,
             utree const& body) const
         {
- compiler_environment local_env(env);
+ environment local_env(env);
             for (std::size_t i = 0; i < args.size(); ++i)
                 local_env.define(args[i], boost::bind(arg, i));
             env.define(name,
- function_compiler(call(compile(body, local_env), args.size())));
+ function_composer(lambda(compile(body, local_env), args.size())));
         }
 
         void define_nullary_function(
@@ -113,7 +111,7 @@
             utree const& body) const
         {
             env.define(name,
- function_compiler(call(compile(body, env), 0)));
+ function_composer(lambda(compile(body, env), 0)));
         }
 
         template <typename Iterator>
@@ -157,14 +155,14 @@
         }
     };
 
- function compile(utree const& ast, compiler_environment& env)
+ actor compile(utree const& ast, environment& env)
     {
         return utree::visit(ast, compiler(env));
     }
 
     void compile_all(
         utree const& ast,
- compiler_environment& env,
+ environment& env,
         function_list& results)
     {
         BOOST_FOREACH(utree const& program, ast)
@@ -174,7 +172,7 @@
         }
     }
 
- void build_basic_environment(compiler_environment& env)
+ void build_basic_environment(environment& env)
     {
         env.define("+", plus_composer());
     }

Copied: branches/release/libs/spirit/example/scheme/scheme_interpreter.hpp (from r61190, /trunk/libs/spirit/example/scheme/scheme_interpreter.hpp)
==============================================================================
--- /trunk/libs/spirit/example/scheme/scheme_interpreter.hpp (original)
+++ branches/release/libs/spirit/example/scheme/scheme_interpreter.hpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -105,13 +105,13 @@
     plus_composer const plus = {};
 
     ///////////////////////////////////////////////////////////////////////////
- // call
+ // lambda
     ///////////////////////////////////////////////////////////////////////////
- struct call_function
+ struct lambda_function
     {
- function_list elements;
- function f;
- call_function(function const& f, function_list const& elements)
+ actor_list elements;
+ actor f;
+ lambda_function(actor const& f, actor_list const& elements)
           : elements(elements), f(f) {}
 
         typedef utree result_type;
@@ -126,11 +126,11 @@
         }
     };
 
- struct call_composer
+ struct lambda_composer
     {
         function f;
         int arity;
- call_composer(function const& f, int arity)
+ lambda_composer(actor const& f, int arity)
           : f(f), arity(arity) {}
 
         typedef function result_type;
@@ -138,13 +138,13 @@
         {
             // $$$ use throw $$$
             BOOST_ASSERT(elements.size() == arity);
- return function(call_function(f, elements));
+ return actor(lambda_function(f, elements));
         }
     };
 
- inline call_composer const call(function const& f, int arity)
+ inline function_composer const lambda(actor const& f, int arity)
     {
- return call_composer(f, arity);
+ return lambda_composer(f, arity);
     }
 }
 

Modified: branches/release/libs/spirit/example/scheme/test/scheme.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/scheme.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/scheme.cpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -8,6 +8,8 @@
 
 #include "../input/sexpr.hpp"
 #include "../input/parse_sexpr_impl.hpp"
+#include "../scheme_interpreter.hpp"
+#include "../scheme_compiler.hpp"
 #include <iostream>
 #include <fstream>
 
@@ -17,85 +19,24 @@
     return out;
 }
 
-#include <boost/unordered_map.hpp>
-
-namespace scheme
-{
- class environment
- {
- public:
-
- environment(environment* parent = 0)
- : bindings(), parent(parent) {}
-
- void define(std::string const& name, utree const& def)
- {
- // check for duplicate names
- BOOST_ASSERT(bindings.find(name) == bindings.end());
- // $$$ TODO Use exceptions $$$
- bindings[name] = def;
- }
-
- utree* find(std::string const& name)
- {
- map::iterator i = bindings.find(name);
- if (i == bindings.end())
- {
- if (parent)
- return parent->find(name);
- return 0;
- }
- return &i->second;
- }
-
- private:
-
- typedef boost::unordered_map<std::string, utree> map;
- map bindings;
- environment* parent;
- };
-
- ///////////////////////////////////////////////////////////////////////////
- // Intrinsic functions
- ///////////////////////////////////////////////////////////////////////////
- struct arithmetic_function
- {
- typedef bool result_type;
-
- template <typename A, typename B>
- bool dispatch(const A&, const B&, boost::mpl::false_) const
- {
- return false; // cannot compare different types by default
- }
-
- template <typename A, typename B>
- bool dispatch(const A& a, const B& b, boost::mpl::true_) const
- {
- return a == b; // for arithmetic types
- }
-
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const
- {
- return dispatch(a, b,
- boost::mpl::and_<
- boost::is_arithmetic<A>,
- boost::is_arithmetic<B> >());
- }
- };
-
- utree plus(environment*, utree& args)
- {
-
- }
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 // Main program
 ///////////////////////////////////////////////////////////////////////////////
 int main(int argc, char **argv)
 {
- char const* filename;
+ { // testing the c++ side
+
+ using scheme::plus;
+ using scheme::_1;
+ using scheme::_2;
+
+ std::cout << "result: " << plus(11, 22, 33) () << std::endl;
+ std::cout << "result: " << plus(11, 22, _1) (33) << std::endl;
+ std::cout << "result: " << plus(11, _1, _2) (22, 33) << std::endl;
+ std::cout << "result: " << plus(11, plus(_1, _2)) (22, 33) << std::endl;
+ }
+
+ char const* filename = NULL;
     if (argc > 1)
     {
         filename = argv[1];
@@ -130,12 +71,18 @@
         }
     }
 
- scheme::utree result;
- if (scheme::input::parse_sexpr(in, result))
+ scheme::utree program;
+ if (scheme::input::parse_sexpr_list(in, program))
     {
- std::cout << "success: ";
- println(std::cout, result);
- std::cout << std::endl;
+ std::cout << "success: " << std::endl;
+ scheme::environment env;
+ scheme::build_basic_environment(env);
+ scheme::function_list flist;
+ compile_all(program, env, flist);
+ BOOST_FOREACH(scheme::function const& f, flist)
+ {
+ std::cout << " result: " << f(scheme::utree()) << std::endl;
+ }
     }
     else
     {

Modified: branches/release/libs/spirit/example/scheme/test/sexpr_input_test.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/sexpr_input_test.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/sexpr_input_test.cpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -22,7 +22,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 int main(int argc, char **argv)
 {
- char const* filename;
+ char const* filename = NULL;
     if (argc > 1)
     {
         filename = argv[1];

Modified: branches/release/libs/spirit/example/scheme/test/sexpr_output_test.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/sexpr_output_test.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/sexpr_output_test.cpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -62,7 +62,7 @@
 
 int main(int argc, char **argv)
 {
- char const* filename_in;
+ char const* filename_in = NULL;
     if (argc > 1)
     {
         filename_in = argv[1];
@@ -73,7 +73,7 @@
         return -1;
     }
 
- char const* filename_out;
+ char const* filename_out = NULL;
     if (argc > 2)
     {
         filename_out = argv[2];

Modified: branches/release/libs/spirit/example/scheme/test/utree_test.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/utree_test.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/utree_test.cpp 2010-07-04 14:45:54 EDT (Sun, 04 Jul 2010)
@@ -13,6 +13,8 @@
 
 inline std::ostream& println(std::ostream& out, scheme::utree const& val)
 {
+ if (val.which() == scheme::utree_type::list_type)
+ out << "size:" << val.size() << " ";
     out << val << std::endl;
     return out;
 }
@@ -21,67 +23,71 @@
 {
     using scheme::utree;
 
- {
- // test the size
- std::cout << "size of utree is: "
- << sizeof(scheme::utree) << " bytes" << std::endl;
- }
-
- {
- utree val;
- println(std::cout, val);
- }
-
- {
- utree val(true);
- println(std::cout, val);
- }
-
- {
- utree val(123);
- println(std::cout, val);
- }
-
- {
- utree val(123.456);
- println(std::cout, val);
- }
-
- {
- utree val("Hello, World");
- println(std::cout, val);
- utree val2;
- val2 = val;
- println(std::cout, val2);
- utree val3("Hello, World. Chuckie is back!!!");
- val = val3;
- println(std::cout, val);
-
- utree val4("Apple");
- utree val5("Apple");
- BOOST_ASSERT(val4 == val5);
-
- utree val6("ApplePie");
- BOOST_ASSERT(val4 < val6);
- }
+ //~ {
+ //~ // test the size
+ //~ std::cout << "size of utree is: "
+ //~ << sizeof(scheme::utree) << " bytes" << std::endl;
+ //~ }
+
+ //~ {
+ //~ utree val;
+ //~ println(std::cout, val);
+ //~ }
+
+ //~ {
+ //~ utree val(true);
+ //~ println(std::cout, val);
+ //~ }
+
+ //~ {
+ //~ utree val(123);
+ //~ println(std::cout, val);
+ //~ }
+
+ //~ {
+ //~ utree val(123.456);
+ //~ println(std::cout, val);
+ //~ }
+
+ //~ {
+ //~ utree val("Hello, World");
+ //~ println(std::cout, val);
+ //~ utree val2;
+ //~ val2 = val;
+ //~ println(std::cout, val2);
+ //~ utree val3("Hello, World. Chuckie is back!!!");
+ //~ val = val3;
+ //~ println(std::cout, val);
+
+ //~ utree val4("Apple");
+ //~ utree val5("Apple");
+ //~ BOOST_ASSERT(val4 == val5);
+
+ //~ utree val6("ApplePie");
+ //~ BOOST_ASSERT(val4 < val6);
+ //~ }
 
     {
         utree val;
         val.push_back(123);
         val.push_back("Chuckie");
+ BOOST_ASSERT(val.size() == 2);
         utree val2;
         val2.push_back(123.456);
         val2.push_back("Mah Doggie");
         val.push_back(val2);
+ BOOST_ASSERT(val.size() == 3);
         println(std::cout, val);
         println(std::cout, val.front());
 
         utree val3;
         val3.swap(val);
+ BOOST_ASSERT(val3.size() == 3);
         println(std::cout, val);
         val3.swap(val);
         println(std::cout, val);
         val.push_back("another string");
+ BOOST_ASSERT(val.size() == 4);
         println(std::cout, val);
         val.pop_front();
         println(std::cout, val);
@@ -93,12 +99,14 @@
         val.pop_back();
         println(std::cout, val);
         BOOST_ASSERT(val.size() == 3);
- val.erase(val.end());
+ utree::iterator it = val.end(); --it;
+ val.erase(it);
         println(std::cout, val);
         BOOST_ASSERT(val.size() == 2);
 
         val.insert(val.begin(), val2.begin(), val2.end());
         println(std::cout, val);
+ BOOST_ASSERT(val.size() == 4);
     }
 
     {


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