5#ifndef QQMLDOMCODEFORMATTER_P_H
6#define QQMLDOMCODEFORMATTER_P_H
24#include <QtCore/QStack>
25#include <QtCore/QList>
27#include <QtCore/QMetaObject>
149 return type == other.type && savedIndentDepth == other.savedIndentDepth;
156 return type == StateType::IfStatement || type == StateType::ElseClause
157 || type == StateType::Substatement || type == StateType::BindingAssignment
158 || type == StateType::BindingOrObjectdefinition;
163 return type == StateType::TopmostIntro || type == StateType::TopJs
164 || type == StateType::ObjectdefinitionOpen || type == StateType::DoStatement
165 || type == StateType::JsblockOpen || type == StateType::SubstatementOpen
166 || type == StateType::BracketOpen || type == StateType::ParenOpen
167 || type == StateType::CaseCont || type == StateType::ObjectliteralOpen;
174 QList<
State>({ State { quint16(baseIndent), StateType::TopmostIntro } }), baseIndent
182 void pushState(StateType type, quint16 savedIndentDepth)
184 states.append(State { savedIndentDepth, type });
189 if (states.isEmpty()) {
193 State res = states.last();
229 lineTokens = tokenize(line, startState);
230 currentStatus.lexerState = tokenize.state();
233 void enterState(FormatTextStatus::StateType newState);
239 int column(
int index)
const;
246 void defaultOnEnter(FormatTextStatus::StateType newState,
int *indentDepth,
247 int *savedIndentDepth)
const;
bool operator==(const State &other) const
static bool isBracelessState(StateType type)
static FormatTextStatus initialStatus(int baseIndent=0)
void pushState(StateType type, quint16 savedIndentDepth)
State state(int belowTop=0) const
Scanner::State lexerState
static bool isExpressionEndState(StateType type)
static bool lexKindIsIdentifier(int kind)
static bool lexKindIsComment(int kind)
static bool lexKindIsInvalid(int kind)
FormatPartialStatus formatCodeLine(QStringView line, const FormatOptions &options, const FormatTextStatus &initialStatus)
int indentForLineStartingWithToken(const FormatTextStatus &oldStatus, const FormatOptions &, int tokenKind)
FormatTextStatus::State State
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)