clang 17.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
clang::format::UnwrappedLine Struct Reference

An unwrapped line is a sequence of Token, that we would like to put on a single line if there was no column limit. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/UnwrappedLineParser.h"

Public Member Functions

 UnwrappedLine ()
 

Public Attributes

std::list< UnwrappedLineNodeTokens
 The Tokens comprising this UnwrappedLine.
 
unsigned Level
 The indent level of the UnwrappedLine.
 
unsigned PPLevel
 The PPBranchLevel (adjusted for header guards) if this line is a InMacroBody line, and 0 otherwise.
 
bool InPPDirective
 Whether this UnwrappedLine is part of a preprocessor directive.
 
bool InPragmaDirective
 Whether this UnwrappedLine is part of a pramga directive.
 
bool InMacroBody
 Whether it is part of a macro body.
 
bool MustBeDeclaration
 
bool IsContinuation = false
 True if this line should be indented by ContinuationIndent in addition to the normal indention level.
 
size_t MatchingOpeningBlockLineIndex = kInvalidIndex
 If this UnwrappedLine closes a block in a sequence of lines, MatchingOpeningBlockLineIndex stores the index of the corresponding opening line.
 
size_t MatchingClosingBlockLineIndex = kInvalidIndex
 If this UnwrappedLine opens a block, stores the index of the line with the corresponding closing brace.
 
unsigned FirstStartColumn = 0
 

Static Public Attributes

static const size_t kInvalidIndex = -1
 

Detailed Description

An unwrapped line is a sequence of Token, that we would like to put on a single line if there was no column limit.

This is used as a main interface between the UnwrappedLineParser and the UnwrappedLineFormatter. The key property is that changing the formatting within an unwrapped line does not affect any other unwrapped lines.

Definition at line 42 of file UnwrappedLineParser.h.

Constructor & Destructor Documentation

◆ UnwrappedLine()

clang::format::UnwrappedLine::UnwrappedLine ( )
inline

Definition at line 419 of file UnwrappedLineParser.h.

Member Data Documentation

◆ FirstStartColumn

unsigned clang::format::UnwrappedLine::FirstStartColumn = 0

Definition at line 80 of file UnwrappedLineParser.h.

◆ InMacroBody

bool clang::format::UnwrappedLine::InMacroBody

Whether it is part of a macro body.

Definition at line 60 of file UnwrappedLineParser.h.

Referenced by clang::format::ScopedMacroState::~ScopedMacroState().

◆ InPPDirective

bool clang::format::UnwrappedLine::InPPDirective

Whether this UnwrappedLine is part of a preprocessor directive.

Definition at line 56 of file UnwrappedLineParser.h.

Referenced by clang::format::ScopedMacroState::~ScopedMacroState().

◆ InPragmaDirective

bool clang::format::UnwrappedLine::InPragmaDirective

Whether this UnwrappedLine is part of a pramga directive.

Definition at line 58 of file UnwrappedLineParser.h.

◆ IsContinuation

bool clang::format::UnwrappedLine::IsContinuation = false

True if this line should be indented by ContinuationIndent in addition to the normal indention level.

Definition at line 66 of file UnwrappedLineParser.h.

◆ kInvalidIndex

const size_t clang::format::UnwrappedLine::kInvalidIndex = -1
static

Definition at line 78 of file UnwrappedLineParser.h.

Referenced by clang::format::getNamespaceToken().

◆ Level

unsigned clang::format::UnwrappedLine::Level

The indent level of the UnwrappedLine.

Definition at line 49 of file UnwrappedLineParser.h.

Referenced by clang::format::ScopedMacroState::~ScopedMacroState().

◆ MatchingClosingBlockLineIndex

size_t clang::format::UnwrappedLine::MatchingClosingBlockLineIndex = kInvalidIndex

If this UnwrappedLine opens a block, stores the index of the line with the corresponding closing brace.

Definition at line 76 of file UnwrappedLineParser.h.

◆ MatchingOpeningBlockLineIndex

size_t clang::format::UnwrappedLine::MatchingOpeningBlockLineIndex = kInvalidIndex

If this UnwrappedLine closes a block in a sequence of lines, MatchingOpeningBlockLineIndex stores the index of the corresponding opening line.

Otherwise, MatchingOpeningBlockLineIndex must be kInvalidIndex.

Definition at line 72 of file UnwrappedLineParser.h.

◆ MustBeDeclaration

bool clang::format::UnwrappedLine::MustBeDeclaration

Definition at line 62 of file UnwrappedLineParser.h.

◆ PPLevel

unsigned clang::format::UnwrappedLine::PPLevel

The PPBranchLevel (adjusted for header guards) if this line is a InMacroBody line, and 0 otherwise.

Definition at line 53 of file UnwrappedLineParser.h.

◆ Tokens

std::list<UnwrappedLineNode> clang::format::UnwrappedLine::Tokens

The Tokens comprising this UnwrappedLine.

Definition at line 46 of file UnwrappedLineParser.h.


The documentation for this struct was generated from the following file: