|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55907 - trunk/tools/quickbook/detail
From: daniel_james_at_[hidden]
Date: 2009-08-31 07:36:34
Author: danieljames
Date: 2009-08-31 07:36:34 EDT (Mon, 31 Aug 2009)
New Revision: 55907
URL: http://svn.boost.org/trac/boost/changeset/55907
Log:
Wrap the template info in a struct.
So that I can add extra scoping info.
Text files modified:
trunk/tools/quickbook/detail/template_stack.cpp | 12 ++++++------
trunk/tools/quickbook/detail/template_stack.hpp | 9 +++++++--
2 files changed, 13 insertions(+), 8 deletions(-)
Modified: trunk/tools/quickbook/detail/template_stack.cpp
==============================================================================
--- trunk/tools/quickbook/detail/template_stack.cpp (original)
+++ trunk/tools/quickbook/detail/template_stack.cpp 2009-08-31 07:36:34 EDT (Mon, 31 Aug 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: trunk/tools/quickbook/detail/template_stack.hpp
==============================================================================
--- trunk/tools/quickbook/detail/template_stack.hpp (original)
+++ trunk/tools/quickbook/detail/template_stack.hpp 2009-08-31 07:36:34 EDT (Mon, 31 Aug 2009)
@@ -40,10 +40,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
{
@@ -62,7 +67,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