mirror of
https://github.com/boostorg/quickbook.git
synced 2026-02-02 09:02:15 +00:00
Quickbook: Check that code snippet grammars always succeed.
[SVN r75625]
This commit is contained in:
@@ -368,18 +368,20 @@ namespace quickbook
|
||||
bool is_python = extension == ".py";
|
||||
code_snippet_actions a(storage, load(filename, qbk_version_n), is_python ? "[python]" : "[c++]");
|
||||
|
||||
// TODO: Should I check that parse succeeded?
|
||||
|
||||
string_iterator first(a.source_file->source.begin());
|
||||
string_iterator last(a.source_file->source.end());
|
||||
|
||||
cl::parse_info<string_iterator> info;
|
||||
|
||||
if(is_python) {
|
||||
boost::spirit::classic::parse(first, last, python_code_snippet_grammar(a));
|
||||
info = boost::spirit::classic::parse(first, last, python_code_snippet_grammar(a));
|
||||
}
|
||||
else {
|
||||
boost::spirit::classic::parse(first, last, cpp_code_snippet_grammar(a));
|
||||
info = boost::spirit::classic::parse(first, last, cpp_code_snippet_grammar(a));
|
||||
}
|
||||
|
||||
assert(info.full);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user