Dump preprocessed file in verbose mode

This commit is contained in:
Jonathan Müller 2017-10-07 09:35:31 +02:00
commit 1b468ea476
3 changed files with 32 additions and 11 deletions

View file

@ -87,12 +87,8 @@ void print_entity(std::ostream& out, const cppast::cpp_entity& e)
}
// no need to handle indentation, as only a single line is used
void do_indent() override
{
}
void do_unindent() override
{
}
void do_indent() override {}
void do_unindent() override {}
// called when a generic token sequence should be generated
// there are specialized callbacks for various token kinds,
@ -249,6 +245,9 @@ int main(int argc, char* argv[]) try
cppast::libclang_compile_config(database, options["file"].as<std::string>());
}
if (options.count("verbose"))
config.write_preprocessed(true);
if (options.count("include_directory"))
for (auto& include : options["include_directory"].as<std::vector<std::string>>())
config.add_include_dir(include);