Quickbook: Fail gracefully if document info is missing.

I also tweaked `pre` and `post` a bit while I was at it.

[SVN r75538]
This commit is contained in:
Daniel James
2011-11-17 21:07:01 +00:00
parent 317704c7b7
commit a041edab9c
5 changed files with 51 additions and 35 deletions

View File

@@ -78,13 +78,16 @@ namespace quickbook
parse_iterator last(actor.current_file->source.end());
cl::parse_info<parse_iterator> info = cl::parse(first, last, actor.grammar().doc_info);
assert(info.hit);
if (!actor.error_count)
{
std::string doc_type = pre(actor.out, actor, include_doc_id, nested_file);
parse_iterator pos = info.stop;
std::string doc_type = pre(actor, pos, include_doc_id, nested_file);
info = cl::parse(info.hit ? info.stop : first, last, actor.grammar().block);
post(actor.out, actor, doc_type);
post(actor, doc_type);
if (!info.full)
{