#include "NamespaceEndCommentsFixer.h"
#include "clang/Basic/TokenKinds.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Regex.h"
#define DEBUG_TYPE …
namespace clang {
namespace format {
namespace {
const FormatToken *
processTokens(const FormatToken *Tok, tok::TokenKind StartTok,
tok::TokenKind EndTok,
llvm::function_ref<void(const FormatToken *)> Fn) { … }
const FormatToken *skipAttribute(const FormatToken *Tok) { … }
std::string computeName(const FormatToken *NamespaceTok) { … }
std::string computeEndCommentText(StringRef NamespaceName, bool AddNewline,
const FormatToken *NamespaceTok,
unsigned SpacesToAdd) { … }
bool hasEndComment(const FormatToken *RBraceTok) { … }
bool validEndComment(const FormatToken *RBraceTok, StringRef NamespaceName,
const FormatToken *NamespaceTok) { … }
void addEndComment(const FormatToken *RBraceTok, StringRef EndCommentText,
const SourceManager &SourceMgr,
tooling::Replacements *Fixes) { … }
void updateEndComment(const FormatToken *RBraceTok, StringRef EndCommentText,
const SourceManager &SourceMgr,
tooling::Replacements *Fixes) { … }
}
const FormatToken *
getNamespaceToken(const AnnotatedLine *Line,
const SmallVectorImpl<AnnotatedLine *> &AnnotatedLines) { … }
StringRef
getNamespaceTokenText(const AnnotatedLine *Line,
const SmallVectorImpl<AnnotatedLine *> &AnnotatedLines) { … }
NamespaceEndCommentsFixer::NamespaceEndCommentsFixer(const Environment &Env,
const FormatStyle &Style)
: … { … }
std::pair<tooling::Replacements, unsigned> NamespaceEndCommentsFixer::analyze(
TokenAnnotator &Annotator, SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,
FormatTokenLexer &Tokens) { … }
}
}