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 {
125 return getRangeLength(LineIndex, Offset, StringRef::npos, StartColumn);
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,
261 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
262 unsigned ContentStartColumn,
263 const llvm::Regex &CommentPragmasRegex)
const override;
265 unsigned ContentIndent,
271 StringRef::size_type Length,
312 unsigned ContentIndent,
343 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
344 unsigned ContentStartColumn,
345 const llvm::Regex &CommentPragmasRegex)
const override;
356 const llvm::Regex &CommentPragmasRegex)
const = 0;
404 unsigned OriginalStartColumn,
bool FirstInLine,
408 Split getSplit(
unsigned LineIndex,
unsigned TailOffset,
unsigned ColumnLimit,
409 unsigned ContentStartColumn,
410 const llvm::Regex &CommentPragmasRegex)
const override;
412 StringRef::size_type Length,
419 unsigned ContentIndent,
422 const llvm::Regex &CommentPragmasRegex)
const override;
423 void reflow(
unsigned LineIndex,
431 const llvm::Regex &CommentPragmasRegex)
const override;
446 void adjustWhitespace(
unsigned LineIndex,
int IndentDelta);
458 unsigned IndentAtLineBreak;
462 bool LastLineNeedsDecoration;
465 StringRef Decoration;
469 unsigned DecorationColumn;
473 bool DelimitersOnNewline;
477 unsigned UnbreakableTailLength;
487 StringRef::size_type Length,
491 unsigned ContentIndent,
494 const llvm::Regex &CommentPragmasRegex)
const override;
495 void reflow(
unsigned LineIndex,
501 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.