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());
99 Current->Children.clear();
100 Current->Role.reset();
101 Current = Current->Next;
111 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
119 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
143 startsWith(tok::kw_inline, tok::kw_namespace) ||
144 startsWith(tok::kw_export, tok::kw_namespace);
198 : Style(Style), Keywords(Keywords) {}
211 bool InFunctionDecl)
const;
213 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
227 bool mustBreakForReturnType(
const AnnotatedLine &Line)
const;
231 void calculateUnbreakableTailLengths(
AnnotatedLine &Line)
const;
233 void calculateArrayInitializerColumnList(
AnnotatedLine &Line)
const;
237 unsigned Depth)
const;
239 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
This file contains the declaration of the UnwrappedLineParser, which turns a stream of tokens into Un...