Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67120 - trunk/boost/spirit/home/support/utree
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-08 22:18:29


Author: hkaiser
Date: 2010-12-08 22:18:28 EST (Wed, 08 Dec 2010)
New Revision: 67120
URL: http://svn.boost.org/trac/boost/changeset/67120

Log:
Spirit: adding missing specializations of customization points for utree
Text files modified:
   trunk/boost/spirit/home/support/utree/utree_traits.hpp | 32 +++++++++++++++++++++++++++-----
   1 files changed, 27 insertions(+), 5 deletions(-)

Modified: trunk/boost/spirit/home/support/utree/utree_traits.hpp
==============================================================================
--- trunk/boost/spirit/home/support/utree/utree_traits.hpp (original)
+++ trunk/boost/spirit/home/support/utree/utree_traits.hpp 2010-12-08 22:18:28 EST (Wed, 08 Dec 2010)
@@ -1,6 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2010 Joel de Guzman
     Copyright (c) 2001-2010 Hartmut Kaiser
+ Copyright (c) 2010 Bryce Lelbach
 
     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)
@@ -54,7 +55,8 @@
     }
 
     template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
- struct assign_to_attribute_from_value<utree, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
+ struct assign_to_attribute_from_value<
+ utree, variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
     {
         static void
         call(variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& val, utree& attr)
@@ -94,8 +96,7 @@
     template <>
     struct assign_to_attribute_from_value<utree, utree>
     {
- static void
- call(utree const& val, utree& attr)
+ static void call(utree const& val, utree& attr)
         {
             attr = val;
         }
@@ -115,6 +116,26 @@
     };
 
     ///////////////////////////////////////////////////////////////////////////
+ // this specialization keeps symbols from being transformed into strings
+ template<>
+ struct assign_to_attribute_from_value<utree, utf8_symbol>
+ {
+ static void call (utf8_symbol const& val, utree& attr)
+ {
+ attr = val;
+ }
+ };
+
+ template<>
+ struct assign_to_attribute_from_value<utree, utf8_symbol_range>
+ {
+ static void call (utf8_symbol_range const& val, utree& attr)
+ {
+ attr = val;
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
     // push_back support for utree allows concatenation of strings
     // (utree strings are immutable)
     template <typename T>
@@ -450,6 +471,7 @@
         }
     };
 
+ ///////////////////////////////////////////////////////////////////////////
     template <>
     struct extract_from_attribute<utree, utf8_symbol>
     {
@@ -535,7 +557,6 @@
         }
     };
 
- ///////////////////////////////////////////////////////////////////////////
     // this specialization is used whenever a utree is passed to a rule as part
     // of a sequence
     template <typename Iterator>
@@ -546,7 +567,8 @@
 
         static type pre(iterator_range<Iterator> const& t)
         {
- return utree(boost::ref(t.front())); // return utree the begin iterator points to
+ // return utree the begin iterator points to
+ return utree(boost::ref(t.front()));
         }
     };
 


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