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;
73 if (
First->MacroParent)
78 if (Node.Tok->MacroParent)
81 Node.Tok->Previous = Current;
82 Current = Current->
Next;
94 for (
const auto &Child : Node.
Children) {
96 if (
Children.back()->ContainsMacroCall)
105 Size += Child->size();
115 Current->
Role.reset();
116 Current = Current->
Next;
121 return First &&
First->is(tok::comment) && !
First->getNextNonComment();
126 template <
typename... Ts>
bool startsWith(Ts... Tokens)
const {
127 return First &&
First->startsSequence(Tokens...);
134 template <
typename... Ts>
bool endsWith(Ts... Tokens)
const {
135 return Last &&
Last->endsSequence(Tokens...);
158 startsWith(tok::kw_inline, tok::kw_namespace) ||
159 startsWith(tok::kw_export, tok::kw_namespace);
169 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;
271 getTokenReferenceAlignment(
const FormatToken &PointerOrReference)
const;
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...
Top level wrappers for InstallAPI frontend operations.
Encapsulates keywords that are context sensitive or for languages not properly supported by Clang's l...