|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72367 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/support/utree boost/spirit/home/support/utree/detail
From: hartmut.kaiser_at_[hidden]
Date: 2011-06-02 21:16:30
Author: hkaiser
Date: 2011-06-02 21:16:29 EDT (Thu, 02 Jun 2011)
New Revision: 72367
URL: http://svn.boost.org/trac/boost/changeset/72367
Log:
Spirit: merging from trunk
Properties modified:
branches/release/ (props changed)
branches/release/boost/ (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
Text files modified:
branches/release/boost/spirit/home/support/utree/detail/utree_detail2.hpp | 10 ++++++++--
branches/release/boost/spirit/home/support/utree/utree.hpp | 11 +++++++----
2 files changed, 15 insertions(+), 6 deletions(-)
Modified: branches/release/boost/spirit/home/support/utree/detail/utree_detail2.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/utree/detail/utree_detail2.hpp (original)
+++ branches/release/boost/spirit/home/support/utree/detail/utree_detail2.hpp 2011-06-02 21:16:29 EDT (Thu, 02 Jun 2011)
@@ -649,7 +649,7 @@
}
template <typename F>
- utree stored_function<F>::operator()(utree& env)
+ utree stored_function<F>::operator()(utree& env) const
{
return f(env);
}
@@ -679,7 +679,7 @@
}
template <typename F>
- utree referenced_function<F>::operator()(utree& env)
+ utree referenced_function<F>::operator()(utree& env) const
{
return f(env);
}
@@ -1593,6 +1593,9 @@
inline utree utree::eval(utree const& env) const
{
+ if (get_type() == type::reference_type)
+ return deref().eval(env);
+
if (get_type() != type::function_type)
BOOST_THROW_EXCEPTION(
bad_type_exception(
@@ -1602,6 +1605,9 @@
inline utree utree::eval(utree& env) const
{
+ if (get_type() == type::reference_type)
+ return deref().eval(env);
+
if (get_type() != type::function_type)
BOOST_THROW_EXCEPTION(
bad_type_exception(
Modified: branches/release/boost/spirit/home/support/utree/utree.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/utree/utree.hpp (original)
+++ branches/release/boost/spirit/home/support/utree/utree.hpp 2011-06-02 21:16:29 EDT (Thu, 02 Jun 2011)
@@ -13,9 +13,11 @@
#include <algorithm>
#include <string>
#include <iostream>
+#include <ios>
#include <sstream>
#include <typeinfo>
+#include <boost/io/ios_state.hpp>
#include <boost/integer.hpp>
#include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
@@ -95,6 +97,7 @@
// streaming operator for utree types - essential for diagnostics
inline std::ostream& operator<<(std::ostream& out, utree_type::info t)
{
+ boost::io::ios_all_saver saver(out);
switch (t) {
case utree_type::invalid_type: { out << "invalid"; break; }
case utree_type::nil_type: { out << "nil"; break; }
@@ -245,7 +248,7 @@
{
virtual ~function_base() {}
virtual utree operator()(utree const& env) const = 0;
- virtual utree operator()(utree& env) = 0;
+ virtual utree operator()(utree& env) const = 0;
// Calling f.clone() must return a newly allocated function_base
// instance that is equal to f.
@@ -259,7 +262,7 @@
stored_function(F f = F());
virtual ~stored_function();
virtual utree operator()(utree const& env) const;
- virtual utree operator()(utree& env);
+ virtual utree operator()(utree& env) const;
virtual function_base* clone() const;
};
@@ -270,7 +273,7 @@
referenced_function(F& f);
virtual ~referenced_function();
virtual utree operator()(utree const& env) const;
- virtual utree operator()(utree& env);
+ virtual utree operator()(utree& env) const;
virtual function_base* clone() const;
};
//]
@@ -384,7 +387,7 @@
// This initializes a `boolean_type` node, which can hold 'true' or
// 'false' only.
- utree(bool);
+ explicit utree(bool);
reference operator=(bool);
// This initializes an `integer_type` node, which can hold arbitrary
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