17#ifndef LLVM_CLANG_LIB_FORMAT_BREAKABLETOKEN_H
18#define LLVM_CLANG_LIB_FORMAT_BREAKABLETOKEN_H
23#include "llvm/ADT/StringSet.h"
24#include "llvm/Support/Regex.h"
92 typedef std::pair<StringRef::size_type, unsigned>
Split;
108 StringRef::size_type Length,
109 unsigned StartColumn)
const = 0;
124 unsigned StartColumn)
const {
136 bool Break)
const = 0;
157 unsigned ColumnLimit,
unsigned ContentStartColumn,
158 const llvm::Regex &CommentPragmasRegex)
const = 0;
162 unsigned ContentIndent,
193 const llvm::Regex &CommentPragmasRegex)
const {
194 return Split(StringRef::npos, 0);
216 return Split(StringRef::npos, 0);
222 Split SplitAfterLastLine,
256 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
257 unsigned ContentStartColumn,
258 const llvm::Regex &CommentPragmasRegex)
const override;
260 unsigned ContentIndent,
266 StringRef::size_type Length,
299 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
300 unsigned ContentStartColumn,
301 const llvm::Regex &CommentPragmasRegex)
const override;
312 const llvm::Regex &CommentPragmasRegex)
const = 0;
360 unsigned OriginalStartColumn,
bool FirstInLine,
364 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
365 unsigned ContentStartColumn,
366 const llvm::Regex &CommentPragmasRegex)
const override;
368 StringRef::size_type Length,
375 unsigned ContentIndent,
378 const llvm::Regex &CommentPragmasRegex)
const override;
379 void reflow(
unsigned LineIndex,
387 const llvm::Regex &CommentPragmasRegex)
const override;
402 void adjustWhitespace(
unsigned LineIndex,
int IndentDelta);
414 unsigned IndentAtLineBreak;
418 bool LastLineNeedsDecoration;
421 StringRef Decoration;
425 unsigned DecorationColumn;
429 bool DelimitersOnNewline;
433 unsigned UnbreakableTailLength;
443 StringRef::size_type Length,
447 unsigned ContentIndent,
450 const llvm::Regex &CommentPragmasRegex)
const override;
451 void reflow(
unsigned LineIndex,
457 const llvm::Regex &CommentPragmasRegex)
const override;
Contains functions for text encoding manipulation.
This file implements a token annotator, i.e.
WhitespaceManager class manages whitespace around tokens and their replacements.
Token - This structure provides full information about a lexed token.