15#ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16#define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
66 assert(!
Line.Tokens.empty());
71 First->Previous =
nullptr;
75 if (Node.Tok->MacroParent)
78 Node.Tok->Previous = Current;
79 Current = Current->
Next;
91 for (
const auto &Child : Node.
Children) {
93 if (
Children.back()->ContainsMacroCall)
102 Size += Child->size();
112 Current->
Role.reset();
113 Current = Current->
Next;
118 return First &&
First->is(tok::comment) && !
First->getNextNonComment();
123 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
124 return First &&
First->startsSequence(Tokens...);
131 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
132 return Last &&
Last->endsSequence(Tokens...);
155 startsWith(tok::kw_inline, tok::kw_namespace) ||
156 startsWith(tok::kw_export, tok::kw_namespace);
161 return startsWith(tok::kw_export, tok::l_brace);
171 return Last->is(tok::comment) ?
Last->getPreviousNonComment() :
Last;
228 : Style(Style), IsCpp(Style.
isCpp()),
242 bool InFunctionDecl)
const;
244 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
269 unsigned Depth)
const;
270 FormatStyle::PointerAlignmentStyle
271 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
273 FormatStyle::PointerAlignmentStyle getTokenPointerOrReferenceAlignment(
276 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...