From: Wolfgang Bangerth Date: Sat, 25 Feb 2023 21:40:16 +0000 (-0700) Subject: Produce .inst files that are easier to read. X-Git-Tag: v9.5.0-rc1~522^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04baaf35fb827484a487cfc62421fc0c389f7122;p=dealii.git Produce .inst files that are easier to read. --- diff --git a/cmake/scripts/expand_instantiations.cc b/cmake/scripts/expand_instantiations.cc index ac3805ef73..1ce2223a91 100644 --- a/cmake/scripts/expand_instantiations.cc +++ b/cmake/scripts/expand_instantiations.cc @@ -112,6 +112,16 @@ get_substring_with_delim(std::string &in, const std::string &delim_list) in.erase(0, 1); } + // We often end up with the '}' delimiter on a separate line, but + // not in the first column of the line. Since whitespace isn't + // harmful, that isn't a problem in itself, except that it makes + // producing nicely formatted output a bit harder than necessary. It + // would be nice if we could just end the text we read with the last + // newline in such cases. To this end, just trim trailing + // whitespace. + while ((x.size() > 0) && (x.back() == ' ')) + x.erase(x.size() - 1, 1); + return x; } @@ -416,8 +426,8 @@ substitute(const std::string & text, static unsigned int counter = 0; std::cout << "#if (SPLIT_INSTANTIATIONS_CHECK(" << counter++ << "))" << std::endl; - std::cout << substitute_tokens(text, name, *expansion) << std::endl; - std::cout << "#endif" << std::endl; + std::cout << substitute_tokens(text, name, *expansion); + std::cout << "#endif" << std::endl << std::endl; } } else