15#ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16#define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
61 assert(!Line.Tokens.empty());
70 if (
Node.Tok->MacroParent)
72 Current->Next =
Node.Tok;
73 Node.Tok->Previous = Current;
74 Current = Current->Next;
85 Current->Children.clear();
86 for (
const auto &Child :
Node.Children) {
88 if (
Children.back()->ContainsMacroCall)
90 Current->Children.push_back(
Children.back());
97 Size += Child->size();
106 Current->Children.clear();
107 Current->Role.reset();
108 Current = Current->Next;
118 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
126 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
150 startsWith(tok::kw_inline, tok::kw_namespace) ||
151 startsWith(tok::kw_export, tok::kw_namespace);
210 : Style(Style), Keywords(Keywords) {}
223 bool InFunctionDecl)
const;
225 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
239 bool mustBreakForReturnType(
const AnnotatedLine &Line)
const;
243 void calculateUnbreakableTailLengths(
AnnotatedLine &Line)
const;
245 void calculateArrayInitializerColumnList(
AnnotatedLine &Line)
const;
249 unsigned Depth)
const;
251 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
This file contains the declaration of the UnwrappedLineParser, which turns a stream of tokens into Un...