|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70865 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-04-02 13:42:58
Author: danieljames
Date: 2011-04-02 13:42:57 EDT (Sat, 02 Apr 2011)
New Revision: 70865
URL: http://svn.boost.org/trac/boost/changeset/70865
Log:
Quickbook: Small code clean ups.
Text files modified:
branches/quickbook-dev/tools/quickbook/src/actions.cpp | 8 ++------
branches/quickbook-dev/tools/quickbook/src/actions.hpp | 2 +-
branches/quickbook-dev/tools/quickbook/src/code_snippet.cpp | 8 ++------
3 files changed, 5 insertions(+), 13 deletions(-)
Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2011-04-02 13:42:57 EDT (Sat, 02 Apr 2011)
@@ -1120,7 +1120,7 @@
iterator last = body.content.get_quickbook_range().end();
return cl::parse(first, last,
- body.is_block ?
+ body.is_block() ?
actions.grammar().block :
actions.grammar().simple_phrase
).full;
@@ -1511,9 +1511,6 @@
actions.qualified_section_id += actions.section_id;
++actions.section_level;
- actions::string_list saved_anchors;
- saved_anchors.swap(actions.anchors);
-
if (qbk_version_n < 103) // version 1.2 and below
{
actions.out << "\n<section id=\""
@@ -1527,7 +1524,6 @@
actions.out << "<title>";
- actions.anchors.swap(saved_anchors);
write_anchors(actions, actions.out);
if (qbk_version_n < 103) // version 1.2 and below
@@ -1764,7 +1760,7 @@
std::string ext = paths.filename.extension().generic_string();
std::vector<template_symbol> storage;
actions.error_count +=
- load_snippets(paths.filename.string(), storage, ext, actions.doc_id);
+ load_snippets(paths.filename.string(), storage, ext);
BOOST_FOREACH(template_symbol& ts, storage)
{
Modified: branches/quickbook-dev/tools/quickbook/src/actions.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.hpp 2011-04-02 13:42:57 EDT (Sat, 02 Apr 2011)
@@ -54,7 +54,7 @@
typedef cl::symbols<std::string> string_symbols;
int load_snippets(std::string const& file, std::vector<template_symbol>& storage,
- std::string const& extension, std::string const& doc_id);
+ std::string const& extension);
std::string syntax_highlight(
iterator first, iterator last,
actions& escape_actions,
Modified: branches/quickbook-dev/tools/quickbook/src/code_snippet.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/code_snippet.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/code_snippet.cpp 2011-04-02 13:42:57 EDT (Sat, 02 Apr 2011)
@@ -25,12 +25,10 @@
{
code_snippet_actions(std::vector<template_symbol>& storage,
std::string const& filename,
- std::string const& doc_id,
char const* source_type)
: callout_id(0)
, storage(storage)
, filename(filename)
- , doc_id(doc_id)
, source_type(source_type)
{}
@@ -85,7 +83,6 @@
std::string id;
std::vector<template_symbol>& storage;
fs::path filename;
- std::string const doc_id;
char const* const source_type;
};
@@ -315,8 +312,7 @@
std::string const& file
, std::vector<template_symbol>& storage // snippets are stored in a
// vector of template_symbols
- , std::string const& extension
- , std::string const& doc_id)
+ , std::string const& extension)
{
std::string code;
int err = detail::load(file, code);
@@ -327,7 +323,7 @@
iterator last(code.end());
bool is_python = extension == ".py";
- code_snippet_actions a(storage, file, doc_id, is_python ? "[python]" : "[c++]");
+ code_snippet_actions a(storage, file, is_python ? "[python]" : "[c++]");
// TODO: Should I check that parse succeeded?
if(is_python) {
boost::spirit::classic::parse(first, last, python_code_snippet_grammar(a));
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