namespace clang {
namespace transformer {
using TextGenerator = MatchConsumer<std::string>;
-/// Wraps a string as a TextGenerator.
-inline TextGenerator text(std::string M) {
- return [M](const ast_matchers::MatchFinder::MatchResult &)
- -> Expected<std::string> { return M; };
-}
// Description of a source-code edit, expressed in terms of an AST node.
// Includes: an ID for the (bound) node, a selector for source related to the
/// Removes the source selected by \p S.
inline ASTEdit remove(RangeSelector S) {
- return change(std::move(S), text(""));
+ return change(std::move(S),
+ [](const ast_matchers::MatchFinder::MatchResult &)
+ -> Expected<std::string> { return ""; });
}
/// The following three functions are a low-level part of the RewriteRule
namespace tooling {
// DEPRECATED: These are temporary aliases supporting client migration to the
// `transformer` namespace.
+/// Wraps a string as a TextGenerator.
+using TextGenerator = transformer::TextGenerator;
+
+inline TextGenerator text(std::string M) {
+ return [M](const ast_matchers::MatchFinder::MatchResult &)
+ -> Expected<std::string> { return M; };
+}
+
using transformer::addInclude;
using transformer::applyFirst;
using transformer::change;
using transformer::insertBefore;
using transformer::makeRule;
using transformer::remove;
-using transformer::text;
using transformer::RewriteRule;
using transformer::IncludeFormat;
namespace detail {
} // namespace transformer
namespace tooling {
-namespace stencil {
// DEPRECATED: These are temporary aliases supporting client migration to the
// `transformer` namespace.
+using Stencil = transformer::Stencil;
+using StencilPart = transformer::StencilPart;
+namespace stencil {
using transformer::access;
using transformer::addressOf;
using transformer::cat;