mirror of
https://github.com/boostorg/quickbook.git
synced 2026-02-02 21:12:15 +00:00
Quickbook: Port Rene's sort code inclusion to quickbook-dev.
[SVN r75175]
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user