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;
}
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