5#ifndef QQMLDOMCODEFORMATTER_P_H
6#define QQMLDOMCODEFORMATTER_P_H
24#include <QtCore/QStack>
25#include <QtCore/QList>
27#include <QtCore/QMetaObject>
155 return type == other.type && savedIndentDepth == other.savedIndentDepth;
162 return type == StateType::IfStatement || type == StateType::ElseClause
163 || type == StateType::Substatement || type == StateType::BindingAssignment
164 || type == StateType::BindingOrObjectdefinition;
169 return type == StateType::TopmostIntro || type == StateType::TopJs
170 || type == StateType::ObjectdefinitionOpen || type == StateType::DoStatement
171 || type == StateType::JsblockOpen || type == StateType::SubstatementOpen
172 || type == StateType::BracketOpen || type == StateType::ParenOpen
173 || type == StateType::CaseCont || type == StateType::ObjectliteralOpen;
180 QList<
State>({ State { quint16(baseIndent), StateType::TopmostIntro } }), baseIndent
188 void pushState(StateType type, quint16 savedIndentDepth)
190 states.append(State { savedIndentDepth, type });
195 if (states.isEmpty()) {
199 State res = states.last();
235 lineTokens = tokenize(line, startState);
236 currentStatus.lexerState = tokenize.state();
239 void enterState(FormatTextStatus::StateType newState);
245 int column(
int index)
const;
252 void defaultOnEnter(FormatTextStatus::StateType newState,
int *indentDepth,
253 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)