Quickbook: Port Rene's sort code inclusion to quickbook-dev.

[SVN r75175]
This commit is contained in:
Daniel James
2011-10-30 09:29:56 +00:00
parent 4012b1f753
commit 4a6dd9e97a
6 changed files with 48 additions and 182 deletions

View File

@@ -329,12 +329,6 @@ namespace quickbook
code_snippet_actions a(storage, file, is_python ? "[python]" : "[c++]");
// TODO: Should I check that parse succeeded?
if (load_type == block_tags::include) {
// Use an id that couldn't occur normally.
a.id = "global tag";
a.start_snippet(first, first);
}
if(is_python) {
boost::spirit::classic::parse(first, last, python_code_snippet_grammar(a));
}
@@ -342,10 +336,6 @@ namespace quickbook
boost::spirit::classic::parse(first, last, cpp_code_snippet_grammar(a));
}
if (load_type == block_tags::include) {
a.end_snippet(first, first);
}
return 0;
}
@@ -411,17 +401,28 @@ namespace quickbook
void code_snippet_actions::escaped_comment(iterator first, iterator last)
{
if(!snippet_stack) return;
if (!snippet_stack)
{
id = "!";
start_snippet(first,first);
}
snippet_data& snippet = *snippet_stack;
append_code();
close_code();
std::string temp(first, last);
detail::unindent(temp); // remove all indents
if (temp.size() != 0)
{
snippet.content += "\n" + temp; // add a linebreak to allow block markups
}
if (snippet.id == "!")
{
end_snippet(first,first);
}
}
void code_snippet_actions::start_snippet(iterator, iterator)