#include "clang/Tooling/Transformer/Parsing.h"
#include "clang/AST/Expr.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Transformer/RangeSelector.h"
#include "clang/Tooling/Transformer/SourceCode.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <optional>
#include <string>
#include <utility>
#include <vector>
usingnamespaceclang;
usingnamespacetransformer;
namespace {
Expected;
RangeSelectorOp;
struct ParseState { … };
template <typename ResultType> struct ParseProgress { … };
ExpectedProgress;
ParseFunction;
class ParseError : public llvm::ErrorInfo<ParseError> { … };
char ParseError::ID;
}
static const llvm::StringMap<RangeSelectorOp<std::string>> &
getUnaryStringSelectors() { … }
static const llvm::StringMap<RangeSelectorOp<RangeSelector>> &
getUnaryRangeSelectors() { … }
static const llvm::StringMap<RangeSelectorOp<std::string, std::string>> &
getBinaryStringSelectors() { … }
static const llvm::StringMap<RangeSelectorOp<RangeSelector, RangeSelector>> &
getBinaryRangeSelectors() { … }
template <typename Element>
std::optional<Element> findOptional(const llvm::StringMap<Element> &Map,
llvm::StringRef Key) { … }
template <typename ResultType>
ParseProgress<ResultType> makeParseProgress(ParseState State,
ResultType Result) { … }
static llvm::Error makeParseError(const ParseState &S, std::string ErrorMsg) { … }
static ParseState advance(ParseState S, size_t N) { … }
static StringRef consumeWhitespace(StringRef S) { … }
static ExpectedProgress<std::nullopt_t> parseChar(char c, ParseState State) { … }
static ExpectedProgress<std::string> parseId(ParseState State) { … }
static ExpectedProgress<std::string> parseStringId(ParseState State) { … }
template <typename T>
ExpectedProgress<RangeSelector> parseSingle(ParseFunction<T> ParseElement,
RangeSelectorOp<T> Op,
ParseState State) { … }
template <typename T>
ExpectedProgress<RangeSelector> parsePair(ParseFunction<T> ParseElement,
RangeSelectorOp<T, T> Op,
ParseState State) { … }
static ExpectedProgress<RangeSelector>
parseRangeSelectorImpl(ParseState State) { … }
Expected<RangeSelector> transformer::parseRangeSelector(llvm::StringRef Input) { … }