15#ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16#define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
67 assert(!
Line.Tokens.empty());
72 First->Previous =
nullptr;
76 if (Node.Tok->MacroParent)
79 Node.Tok->Previous = Current;
80 Current = Current->
Next;
92 for (
const auto &Child : Node.
Children) {
94 if (
Children.back()->ContainsMacroCall)
103 Size += Child->size();
113 Current->
Role.reset();
114 Current = Current->
Next;
119 return First &&
First->is(tok::comment) && !
First->getNextNonComment();
124 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
125 return First &&
First->startsSequence(Tokens...);
132 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
133 return Last &&
Last->endsSequence(Tokens...);
156 startsWith(tok::kw_inline, tok::kw_namespace) ||
157 startsWith(tok::kw_export, tok::kw_namespace);
162 return startsWith(tok::kw_export, tok::l_brace);
172 return Last->is(tok::comment) ?
Last->getPreviousNonComment() :
Last;
230 : Style(Style), IsCpp(Style.
isCpp()),
244 bool InFunctionDecl)
const;
246 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
271 unsigned Depth)
const;
272 FormatStyle::PointerAlignmentStyle
273 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
275 FormatStyle::PointerAlignmentStyle getTokenPointerOrReferenceAlignment(
278 const FormatStyle &Style;
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.
Encapsulates keywords that are context sensitive or for languages not properly supported by Clang's l...