Go to the documentation of this file.
15 #ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16 #define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
47 assert(!
Line.Tokens.empty());
55 Current->Next =
Node.Tok;
56 Node.Tok->Previous = Current;
57 Current = Current->Next;
58 Current->Children.clear();
59 for (
const auto &Child :
Node.Children) {
61 Current->Children.push_back(
Children.back());
73 Current->Children.clear();
74 Current->Role.reset();
75 Current = Current->Next;
85 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
93 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
117 startsWith(tok::kw_inline, tok::kw_namespace) ||
118 startsWith(tok::kw_export, tok::kw_namespace);
159 : Style(Style), Keywords(Keywords) {}
172 bool InFunctionDecl)
const;
174 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
198 unsigned Depth)
const;
200 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
const AnnotatedLine * Line