Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlJS::Dom::FormatTextStatus Class Reference

#include <qqmldomcodeformatter_p.h>

+ Collaboration diagram for QQmlJS::Dom::FormatTextStatus:

Classes

class  State
 

Public Types

enum class  StateType : quint8 {
  Invalid = 0 , TopmostIntro , TopQml , TopJs ,
  ObjectdefinitionOrJs , MultilineCommentStart , MultilineCommentCont , ImportStart ,
  ImportMaybeDotOrVersionOrAs , ImportDot , ImportMaybeAs , ImportAs ,
  PropertyStart , PropertyModifiers , RequiredProperty , PropertyListOpen ,
  PropertyName , PropertyMaybeInitializer , ComponentStart , ComponentName ,
  TypeAnnotation , TypeParameter , EnumStart , SignalStart ,
  SignalMaybeArglist , SignalArglistOpen , FunctionStart , FunctionArglistOpen ,
  FunctionArglistClosed , BindingOrObjectdefinition , BindingAssignment , ObjectdefinitionOpen ,
  Expression , ExpressionContinuation , ExpressionMaybeContinuation , ExpressionOrObjectdefinition ,
  ExpressionOrLabel , ParenOpen , BracketOpen , ObjectliteralOpen ,
  ObjectliteralAssignment , BracketElementStart , BracketElementMaybeObjectdefinition , TernaryOp ,
  TernaryOpAfterColon , JsblockOpen , EmptyStatement , BreakcontinueStatement ,
  IfStatement , MaybeElse , ElseClause , ConditionOpen ,
  Substatement , SubstatementOpen , LabelledStatement , ReturnStatement ,
  ThrowStatement , StatementWithCondition , StatementWithConditionParenOpen , TryStatement ,
  CatchStatement , FinallyStatement , MaybeCatchOrFinally , DoStatement ,
  DoStatementWhileParenOpen , SwitchStatement , CaseStart , CaseCont
}
 

Public Member Functions

size_t size () const
 
State state (int belowTop=0) const
 
void pushState (StateType type, quint16 savedIndentDepth)
 
State popState ()
 

Static Public Member Functions

static QString stateToString (StateType type)
 
static bool isBracelessState (StateType type)
 
static bool isExpressionEndState (StateType type)
 
static FormatTextStatus initialStatus (int baseIndent=0)
 

Public Attributes

Scanner::State lexerState = {}
 
QVector< Statestates
 
int finalIndent = 0
 

Detailed Description

Definition at line 34 of file qqmldomcodeformatter_p.h.

Member Enumeration Documentation

◆ StateType

Enumerator
Invalid 
TopmostIntro 
TopQml 
TopJs 
ObjectdefinitionOrJs 
MultilineCommentStart 
MultilineCommentCont 
ImportStart 
ImportMaybeDotOrVersionOrAs 
ImportDot 
ImportMaybeAs 
ImportAs 
PropertyStart 
PropertyModifiers 
RequiredProperty 
PropertyListOpen 
PropertyName 
PropertyMaybeInitializer 
ComponentStart 
ComponentName 
TypeAnnotation 
TypeParameter 
EnumStart 
SignalStart 
SignalMaybeArglist 
SignalArglistOpen 
FunctionStart 
FunctionArglistOpen 
FunctionArglistClosed 
BindingOrObjectdefinition 
BindingAssignment 
ObjectdefinitionOpen 
Expression 
ExpressionContinuation 
ExpressionMaybeContinuation 
ExpressionOrObjectdefinition 
ExpressionOrLabel 
ParenOpen 
BracketOpen 
ObjectliteralOpen 
ObjectliteralAssignment 
BracketElementStart 
BracketElementMaybeObjectdefinition 
TernaryOp 
TernaryOpAfterColon 
JsblockOpen 
EmptyStatement 
BreakcontinueStatement 
IfStatement 
MaybeElse 
ElseClause 
ConditionOpen 
Substatement 
SubstatementOpen 
LabelledStatement 
ReturnStatement 
ThrowStatement 
StatementWithCondition 
StatementWithConditionParenOpen 
TryStatement 
CatchStatement 
FinallyStatement 
MaybeCatchOrFinally 
DoStatement 
DoStatementWhileParenOpen 
SwitchStatement 
CaseStart 
CaseCont 

Definition at line 38 of file qqmldomcodeformatter_p.h.

Member Function Documentation

◆ initialStatus()

static FormatTextStatus QQmlJS::Dom::FormatTextStatus::initialStatus ( int baseIndent = 0)
inlinestatic

Definition at line 170 of file qqmldomcodeformatter_p.h.

◆ isBracelessState()

static bool QQmlJS::Dom::FormatTextStatus::isBracelessState ( StateType type)
inlinestatic

Definition at line 154 of file qqmldomcodeformatter_p.h.

Referenced by QQmlJS::Dom::FormatPartialStatus::defaultOnEnter().

+ Here is the caller graph for this function:

◆ isExpressionEndState()

static bool QQmlJS::Dom::FormatTextStatus::isExpressionEndState ( StateType type)
inlinestatic

Definition at line 161 of file qqmldomcodeformatter_p.h.

Referenced by QQmlJS::Dom::FormatPartialStatus::defaultOnEnter(), and QQmlJS::Dom::FormatPartialStatus::leaveState().

+ Here is the caller graph for this function:

◆ popState()

State QQmlJS::Dom::FormatTextStatus::popState ( )
inline

Definition at line 187 of file qqmldomcodeformatter_p.h.

References Q_ASSERT.

Referenced by QQmlJS::Dom::FormatPartialStatus::leaveState().

+ Here is the caller graph for this function:

◆ pushState()

void QQmlJS::Dom::FormatTextStatus::pushState ( StateType type,
quint16 savedIndentDepth )
inline

Definition at line 182 of file qqmldomcodeformatter_p.h.

Referenced by QQmlJS::Dom::FormatPartialStatus::enterState().

+ Here is the caller graph for this function:

◆ size()

size_t QQmlJS::Dom::FormatTextStatus::size ( ) const
inline

Definition at line 178 of file qqmldomcodeformatter_p.h.

Referenced by QQmlJS::Dom::FormatPartialStatus::indentLine(), and QQmlJS::Dom::FormatPartialStatus::leaveState().

+ Here is the caller graph for this function:

◆ state()

State QQmlJS::Dom::FormatTextStatus::state ( int belowTop = 0) const

Definition at line 18 of file qqmldomcodeformatter.cpp.

Referenced by QQmlJS::Dom::FormatPartialStatus::defaultOnEnter(), QQmlJS::Dom::FormatPartialStatus::handleTokens(), QQmlJS::Dom::indentForLineStartingWithToken(), and QQmlJS::Dom::FormatPartialStatus::leaveState().

+ Here is the caller graph for this function:

◆ stateToString()

QString QQmlJS::Dom::FormatTextStatus::stateToString ( StateType type)
static

Definition at line 26 of file qqmldomcodeformatter.cpp.

References QString::fromUtf8().

Referenced by QQmlJS::Dom::FormatPartialStatus::dump(), QQmlJS::Dom::FormatPartialStatus::enterState(), and QQmlJS::Dom::FormatPartialStatus::leaveState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ finalIndent

◆ lexerState

◆ states

QVector<State> QQmlJS::Dom::FormatTextStatus::states

Definition at line 199 of file qqmldomcodeformatter_p.h.

Referenced by QQmlJS::Dom::FormatPartialStatus::dump().


The documentation for this class was generated from the following files: