15 #ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16 #define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
60 assert(!Line.Tokens.empty());
69 if (
Node.Tok->MacroParent)
71 Current->Next =
Node.Tok;
72 Node.Tok->Previous = Current;
73 Current = Current->Next;
84 Current->Children.clear();
85 for (
const auto &Child :
Node.Children) {
87 if (
Children.back()->ContainsMacroCall)
89 Current->Children.push_back(
Children.back());
96 Size += Child->size();
105 Current->Children.clear();
106 Current->Role.reset();
107 Current = Current->Next;
117 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
125 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
149 startsWith(tok::kw_inline, tok::kw_namespace) ||
150 startsWith(tok::kw_export, tok::kw_namespace);
214 : Style(Style), IsCpp(Style.isCpp()),
216 assert(IsCpp == LangOpts.CXXOperatorNames);
230 bool InFunctionDecl)
const;
232 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
246 bool mustBreakForReturnType(
const AnnotatedLine &Line)
const;
250 void calculateUnbreakableTailLengths(
AnnotatedLine &Line)
const;
252 void calculateArrayInitializerColumnList(
AnnotatedLine &Line)
const;
256 unsigned Depth)
const;
258 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
This file contains the declaration of the UnwrappedLineParser, which turns a stream of tokens into Un...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
The JSON file list parser is used to communicate input to InstallAPI.