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;
56 bool BinPackInconclusiveFunctions);
62 LineState getInitialState(
unsigned FirstIndent,
unsigned FirstStartColumn,
81 unsigned addTokenToState(
LineState &State,
bool Newline,
bool DryRun,
82 unsigned ExtraSpaces = 0);
86 unsigned getColumnLimit(
const LineState &State)
const;
91 unsigned moveStateToNextToken(
LineState &State,
bool DryRun,
bool Newline);
94 void moveStatePastFakeLParens(
LineState &State,
bool Newline);
96 void moveStatePastFakeRParens(
LineState &State);
99 void moveStatePastScopeOpener(
LineState &State,
bool Newline);
101 void moveStatePastScopeCloser(
LineState &State);
103 void moveStateToNewBlock(
LineState &State);
108 unsigned reformatRawStringLiteral(
const FormatToken &Current,
116 bool DryRun,
bool AllowBreak);
141 std::pair<unsigned, bool> breakProtrudingToken(
const FormatToken &Current,
143 bool AllowBreak,
bool DryRun,
148 std::unique_ptr<BreakableToken>
159 void addTokenOnCurrentLine(
LineState &State,
bool DryRun,
160 unsigned ExtraSpaces);
169 unsigned addTokenOnNewLine(
LineState &State,
bool DryRun);
172 unsigned getNewLineColumn(
const LineState &State);
186 bool nextIsMultilineString(
const LineState &State);
193 bool BinPackInconclusiveFunctions;
194 llvm::Regex CommentPragmasRegex;
199 ParenState(
unsigned Indent,
unsigned LastSpace,
bool AvoidBinPacking,
201 : Indent(Indent), LastSpace(LastSpace), NestedBlockIndent(Indent),
202 BreakBeforeClosingBrace(
false), AvoidBinPacking(AvoidBinPacking),
203 BreakBeforeParameter(
false), NoLineBreak(NoLineBreak),
204 NoLineBreakInOperand(
false), LastOperatorWrapped(
true),
205 ContainsLineBreak(
false), ContainsUnwrappedBuilder(
false),
206 AlignColons(
true), ObjCSelectorNameFound(
false),
207 HasMultipleNestedBlocks(
false), NestedBlockInlined(
false) {}
228 unsigned FirstLessLess = 0;
231 unsigned QuestionColumn = 0;
234 unsigned ColonPos = 0;
237 unsigned StartOfFunctionCall = 0;
241 unsigned StartOfArraySubscripts = 0;
245 unsigned NestedNameSpecifierContinuation = 0;
249 unsigned CallContinuation = 0;
254 unsigned VariablePos = 0;
318 if (Indent != Other.
Indent)
319 return Indent < Other.
Indent;
327 return BreakBeforeClosingBrace;
331 return AvoidBinPacking;
333 return BreakBeforeParameter;
337 return LastOperatorWrapped;
349 return ContainsLineBreak;
351 return ContainsUnwrappedBuilder;
353 return NestedBlockInlined;
415 if (Column != Other.
Column)
416 return Column < Other.
Column;
417 if (LineContainsContinuedForLoopSection !=
419 return LineContainsContinuedForLoopSection;
421 return NoContinuation;
430 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.