Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53449 - branches/quickbook-1.5/detail
From: daniel_james_at_[hidden]
Date: 2009-05-30 09:01:36


Author: danieljames
Date: 2009-05-30 09:01:35 EDT (Sat, 30 May 2009)
New Revision: 53449
URL: http://svn.boost.org/trac/boost/changeset/53449

Log:
Wrap the template info in a struct.

So that I can add extra scoping info.
Text files modified:
   branches/quickbook-1.5/detail/template_stack.cpp | 12 ++++++------
   branches/quickbook-1.5/detail/template_stack.hpp | 9 +++++++--
   2 files changed, 13 insertions(+), 8 deletions(-)

Modified: branches/quickbook-1.5/detail/template_stack.cpp
==============================================================================
--- branches/quickbook-1.5/detail/template_stack.cpp (original)
+++ branches/quickbook-1.5/detail/template_stack.cpp 2009-05-30 09:01:35 EDT (Sat, 30 May 2009)
@@ -18,14 +18,14 @@
         : scope(template_stack::parser(*this))
         , scopes()
     {
- scopes.push_front(template_symbols());
+ scopes.push_front(template_scope());
     }
     
     template_symbol* template_stack::find(std::string const& symbol) const
     {
         for (deque::const_iterator i = scopes.begin(); i != scopes.end(); ++i)
         {
- if (template_symbol* ts = boost::spirit::classic::find(*i, symbol.c_str()))
+ if (template_symbol* ts = boost::spirit::classic::find(i->symbols, symbol.c_str()))
                 return ts;
         }
         return 0;
@@ -33,24 +33,24 @@
 
     template_symbol* template_stack::find_top_scope(std::string const& symbol) const
     {
- return boost::spirit::classic::find(scopes.front(), symbol.c_str());
+ return boost::spirit::classic::find(scopes.front().symbols, symbol.c_str());
     }
 
     template_symbols const& template_stack::top() const
     {
         BOOST_ASSERT(!scopes.empty());
- return scopes.front();
+ return scopes.front().symbols;
     }
     
     void template_stack::add(std::string const& symbol, template_symbol const& ts)
     {
         BOOST_ASSERT(!scopes.empty());
- boost::spirit::classic::add(scopes.front(), symbol.c_str(), ts);
+ boost::spirit::classic::add(scopes.front().symbols, symbol.c_str(), ts);
     }
     
     void template_stack::push()
     {
- scopes.push_front(template_symbols());
+ scopes.push_front(template_scope());
     }
 
     void template_stack::pop()

Modified: branches/quickbook-1.5/detail/template_stack.hpp
==============================================================================
--- branches/quickbook-1.5/detail/template_stack.hpp (original)
+++ branches/quickbook-1.5/detail/template_stack.hpp 2009-05-30 09:01:35 EDT (Sat, 30 May 2009)
@@ -36,10 +36,15 @@
     template_symbol;
 
     typedef boost::spirit::classic::symbols<template_symbol> template_symbols;
+
+ struct template_scope
+ {
+ template_symbols symbols;
+ };
 
     struct template_stack
     {
- typedef std::deque<template_symbols> deque;
+ typedef std::deque<template_scope> deque;
 
         struct parser
         {
@@ -58,7 +63,7 @@
                 for (template_stack::deque::const_iterator i = ts.scopes.begin();
                     i != ts.scopes.end(); ++i)
                 {
- boost::spirit::classic::match<> m = i->parse(scan);
+ boost::spirit::classic::match<> m = i->symbols.parse(scan);
                     if (m.length() > len)
                         len = m.length();
                     scan.first = f;


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