16 #ifndef LLVM_CLANG_LIB_FORMAT_CONTINUATIONINDENTER_H 17 #define LLVM_CLANG_LIB_FORMAT_CONTINUATIONINDENTER_H 22 #include "llvm/Support/Regex.h" 36 struct RawStringFormatStyleManager;
37 class WhitespaceManager;
60 bool BinPackInconclusiveFunctions);
66 LineState getInitialState(
unsigned FirstIndent,
unsigned FirstStartColumn,
85 unsigned addTokenToState(
LineState &State,
bool Newline,
bool DryRun,
86 unsigned ExtraSpaces = 0);
90 unsigned getColumnLimit(
const LineState &State)
const;
95 unsigned moveStateToNextToken(
LineState &State,
bool DryRun,
bool Newline);
98 void moveStatePastFakeLParens(
LineState &State,
bool Newline);
100 void moveStatePastFakeRParens(
LineState &State);
103 void moveStatePastScopeOpener(
LineState &State,
bool Newline);
105 void moveStatePastScopeCloser(
LineState &State);
107 void moveStateToNewBlock(
LineState &State);
112 unsigned reformatRawStringLiteral(
const FormatToken &Current,
120 bool DryRun,
bool AllowBreak);
145 std::pair<unsigned, bool> breakProtrudingToken(
const FormatToken &Current,
147 bool AllowBreak,
bool DryRun,
152 std::unique_ptr<BreakableToken>
163 void addTokenOnCurrentLine(
LineState &State,
bool DryRun,
164 unsigned ExtraSpaces);
173 unsigned addTokenOnNewLine(
LineState &State,
bool DryRun);
176 unsigned getNewLineColumn(
const LineState &State);
190 bool nextIsMultilineString(
const LineState &State);
197 bool BinPackInconclusiveFunctions;
198 llvm::Regex CommentPragmasRegex;
204 bool AvoidBinPacking,
bool NoLineBreak)
205 : Tok(Tok), Indent(Indent), LastSpace(LastSpace),
206 NestedBlockIndent(Indent), BreakBeforeClosingBrace(
false),
207 AvoidBinPacking(AvoidBinPacking), BreakBeforeParameter(
false),
208 NoLineBreak(NoLineBreak), NoLineBreakInOperand(
false),
209 LastOperatorWrapped(
true), ContainsLineBreak(
false),
210 ContainsUnwrappedBuilder(
false), AlignColons(
true),
211 ObjCSelectorNameFound(
false), HasMultipleNestedBlocks(
false),
212 NestedBlockInlined(
false), IsInsideObjCArrayLiteral(
false) {}
240 unsigned FirstLessLess = 0;
243 unsigned QuestionColumn = 0;
246 unsigned ColonPos = 0;
249 unsigned StartOfFunctionCall = 0;
253 unsigned StartOfArraySubscripts = 0;
257 unsigned NestedNameSpecifierContinuation = 0;
261 unsigned CallContinuation = 0;
266 unsigned VariablePos = 0;
334 if (Indent != Other.
Indent)
335 return Indent < Other.
Indent;
343 return BreakBeforeClosingBrace;
347 return AvoidBinPacking;
349 return BreakBeforeParameter;
353 return LastOperatorWrapped;
365 return ContainsLineBreak;
367 return ContainsUnwrappedBuilder;
369 return NestedBlockInlined;
431 if (Column != Other.
Column)
432 return Column < Other.
Column;
433 if (LineContainsContinuedForLoopSection !=
435 return LineContainsContinuedForLoopSection;
437 return NoContinuation;
446 return Stack < Other.
Stack;
Contains functions for text encoding manipulation.
const AnnotatedLine * Line
Dataflow Directional Tag Classes.
This class handles loading and caching of source files into memory.