15#ifndef LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
16#define LLVM_CLANG_LIB_FORMAT_TOKENANNOTATOR_H
64 assert(!
Line.Tokens.empty());
69 First->Previous =
nullptr;
73 if (Node.Tok->MacroParent)
76 Node.Tok->Previous = Current;
77 Current = Current->
Next;
89 for (
const auto &Child : Node.
Children) {
91 if (
Children.back()->ContainsMacroCall)
100 Size += Child->size();
110 Current->
Role.reset();
111 Current = Current->
Next;
116 return First &&
First->is(tok::comment) && !
First->getNextNonComment();
121 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
122 return First &&
First->startsSequence(Tokens...);
129 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
130 return Last &&
Last->endsSequence(Tokens...);
153 startsWith(tok::kw_inline, tok::kw_namespace) ||
154 startsWith(tok::kw_export, tok::kw_namespace);
159 return startsWith(tok::kw_export, tok::l_brace);
169 return Last->is(tok::comment) ?
Last->getPreviousNonComment() :
Last;
226 : Style(Style), IsCpp(Style.
isCpp()),
240 bool InFunctionDecl)
const;
242 bool spaceRequiredBeforeParens(
const FormatToken &Right)
const;
266 unsigned Depth)
const;
267 FormatStyle::PointerAlignmentStyle
268 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
270 FormatStyle::PointerAlignmentStyle getTokenPointerOrReferenceAlignment(
273 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...