mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:44:46 +01:00
Add tests to the cpp_refactoring tool. (#539)
This refactors the main.cpp out into a file structure that should make it easier to add more matchers/tests.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#ifndef MIGRATE_CPP_CPP_REFACTORING_FN_INSERTER_H_
|
||||
#define MIGRATE_CPP_CPP_REFACTORING_FN_INSERTER_H_
|
||||
|
||||
#include "migrate_cpp/cpp_refactoring/matcher.h"
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
// Inserts `fn` for functions and methods.
|
||||
class FnInserter : public Matcher {
|
||||
public:
|
||||
explicit FnInserter(std::map<std::string, Replacements>& in_replacements,
|
||||
MatchFinder* finder);
|
||||
|
||||
void run(const MatchFinder::MatchResult& result) override;
|
||||
|
||||
private:
|
||||
static constexpr char Label[] = "FnInserter";
|
||||
};
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
#endif // MIGRATE_CPP_CPP_REFACTORING_FN_INSERTER_H_
|
||||
Reference in New Issue
Block a user