forked from qt-creator/qt-creator
qmljs: Use C++11’s override and remove virtual where applicable
Fixes warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] Change-Id: I17955fd0fdb052678228f1bda32cd8d3b4298998 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -70,7 +70,7 @@ public:
|
|||||||
_message = Message(type, _location);
|
_message = Message(type, _location);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const NumberValue *value)
|
void visit(const NumberValue *value) override
|
||||||
{
|
{
|
||||||
if (const QmlEnumValue *enumValue = value_cast<QmlEnumValue>(value)) {
|
if (const QmlEnumValue *enumValue = value_cast<QmlEnumValue>(value)) {
|
||||||
if (StringLiteral *stringLiteral = cast<StringLiteral *>(_ast)) {
|
if (StringLiteral *stringLiteral = cast<StringLiteral *>(_ast)) {
|
||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const BooleanValue *)
|
void visit(const BooleanValue *) override
|
||||||
{
|
{
|
||||||
UnaryMinusExpression *unaryMinus = cast<UnaryMinusExpression *>(_ast);
|
UnaryMinusExpression *unaryMinus = cast<UnaryMinusExpression *>(_ast);
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const StringValue *value)
|
void visit(const StringValue *value) override
|
||||||
{
|
{
|
||||||
UnaryMinusExpression *unaryMinus = cast<UnaryMinusExpression *>(_ast);
|
UnaryMinusExpression *unaryMinus = cast<UnaryMinusExpression *>(_ast);
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const ColorValue *)
|
void visit(const ColorValue *) override
|
||||||
{
|
{
|
||||||
if (StringLiteral *stringLiteral = cast<StringLiteral *>(_ast)) {
|
if (StringLiteral *stringLiteral = cast<StringLiteral *>(_ast)) {
|
||||||
if (!toQColor(stringLiteral->value.toString()).isValid())
|
if (!toQColor(stringLiteral->value.toString()).isValid())
|
||||||
@@ -142,7 +142,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void visit(const AnchorLineValue *)
|
void visit(const AnchorLineValue *) override
|
||||||
{
|
{
|
||||||
if (! (_rhsValue->asAnchorLineValue() || _rhsValue->asUnknownValue()))
|
if (! (_rhsValue->asAnchorLineValue() || _rhsValue->asUnknownValue()))
|
||||||
setMessage(ErrAnchorLineExpected);
|
setMessage(ErrAnchorLineExpected);
|
||||||
@@ -189,7 +189,7 @@ protected:
|
|||||||
return _state;
|
return _state;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool preVisit(Node *ast)
|
bool preVisit(Node *ast) override
|
||||||
{
|
{
|
||||||
if (ast->expressionCast())
|
if (ast->expressionCast())
|
||||||
return false;
|
return false;
|
||||||
@@ -204,7 +204,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(LabelledStatement *ast)
|
bool visit(LabelledStatement *ast) override
|
||||||
{
|
{
|
||||||
// get the target statement
|
// get the target statement
|
||||||
Statement *end = ast->statement;
|
Statement *end = ast->statement;
|
||||||
@@ -219,7 +219,7 @@ protected:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(BreakStatement *ast)
|
bool visit(BreakStatement *ast) override
|
||||||
{
|
{
|
||||||
_state = Break;
|
_state = Break;
|
||||||
if (!ast->label.isEmpty()) {
|
if (!ast->label.isEmpty()) {
|
||||||
@@ -232,12 +232,12 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// labelled continues don't change control flow...
|
// labelled continues don't change control flow...
|
||||||
virtual bool visit(ContinueStatement *) { _state = Continue; return false; }
|
bool visit(ContinueStatement *) override { _state = Continue; return false; }
|
||||||
|
|
||||||
virtual bool visit(ReturnStatement *) { _state = ReturnOrThrow; return false; }
|
bool visit(ReturnStatement *) override { _state = ReturnOrThrow; return false; }
|
||||||
virtual bool visit(ThrowStatement *) { _state = ReturnOrThrow; return false; }
|
bool visit(ThrowStatement *) override { _state = ReturnOrThrow; return false; }
|
||||||
|
|
||||||
virtual bool visit(IfStatement *ast)
|
bool visit(IfStatement *ast) override
|
||||||
{
|
{
|
||||||
State ok = check(ast->ok);
|
State ok = check(ast->ok);
|
||||||
State ko = check(ast->ko);
|
State ko = check(ast->ko);
|
||||||
@@ -256,7 +256,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(SwitchStatement *ast)
|
bool visit(SwitchStatement *ast) override
|
||||||
{
|
{
|
||||||
if (!ast->block)
|
if (!ast->block)
|
||||||
return false;
|
return false;
|
||||||
@@ -282,7 +282,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(TryStatement *ast)
|
bool visit(TryStatement *ast) override
|
||||||
{
|
{
|
||||||
State tryBody = check(ast->statement);
|
State tryBody = check(ast->statement);
|
||||||
State catchBody = ReturnOrThrow;
|
State catchBody = ReturnOrThrow;
|
||||||
@@ -303,13 +303,13 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(WhileStatement *ast) { return preconditionLoopStatement(ast, ast->statement); }
|
bool visit(WhileStatement *ast) override { return preconditionLoopStatement(ast, ast->statement); }
|
||||||
virtual bool visit(ForStatement *ast) { return preconditionLoopStatement(ast, ast->statement); }
|
bool visit(ForStatement *ast) override { return preconditionLoopStatement(ast, ast->statement); }
|
||||||
virtual bool visit(ForEachStatement *ast) { return preconditionLoopStatement(ast, ast->statement); }
|
bool visit(ForEachStatement *ast) override { return preconditionLoopStatement(ast, ast->statement); }
|
||||||
virtual bool visit(LocalForStatement *ast) { return preconditionLoopStatement(ast, ast->statement); }
|
bool visit(LocalForStatement *ast) override { return preconditionLoopStatement(ast, ast->statement); }
|
||||||
virtual bool visit(LocalForEachStatement *ast) { return preconditionLoopStatement(ast, ast->statement); }
|
bool visit(LocalForEachStatement *ast) override { return preconditionLoopStatement(ast, ast->statement); }
|
||||||
|
|
||||||
virtual bool visit(DoWhileStatement *ast)
|
bool visit(DoWhileStatement *ast) override
|
||||||
{
|
{
|
||||||
check(ast->statement);
|
check(ast->statement);
|
||||||
// not necessarily an infinite loop due to labelled breaks
|
// not necessarily an infinite loop due to labelled breaks
|
||||||
@@ -335,7 +335,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual State check(Node *node)
|
State check(Node *node) override
|
||||||
{
|
{
|
||||||
bool oldwarning = _emittedWarning;
|
bool oldwarning = _emittedWarning;
|
||||||
_emittedWarning = false;
|
_emittedWarning = false;
|
||||||
@@ -344,7 +344,7 @@ protected:
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void onUnreachable(Node *node)
|
void onUnreachable(Node *node) override
|
||||||
{
|
{
|
||||||
if (_emittedWarning)
|
if (_emittedWarning)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool visit(CompoundStatementAST *ast)
|
bool visit(CompoundStatementAST *ast) override
|
||||||
{
|
{
|
||||||
CompoundStatementAST *old = _compound;
|
CompoundStatementAST *old = _compound;
|
||||||
_compound = ast;
|
_compound = ast;
|
||||||
@@ -128,7 +128,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(CallAST *ast)
|
bool visit(CallAST *ast) override
|
||||||
{
|
{
|
||||||
if (checkForQmlRegisterType(ast))
|
if (checkForQmlRegisterType(ast))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -103,27 +103,27 @@ public:
|
|||||||
|
|
||||||
const Value *value() const { return m_value; }
|
const Value *value() const { return m_value; }
|
||||||
|
|
||||||
virtual bool processProperty(const QString &name, const Value *value, const PropertyInfo &)
|
bool processProperty(const QString &name, const Value *value, const PropertyInfo &) override
|
||||||
{
|
{
|
||||||
return process(name, value);
|
return process(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processEnumerator(const QString &name, const Value *value)
|
bool processEnumerator(const QString &name, const Value *value) override
|
||||||
{
|
{
|
||||||
return process(name, value);
|
return process(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSignal(const QString &name, const Value *value)
|
bool processSignal(const QString &name, const Value *value) override
|
||||||
{
|
{
|
||||||
return process(name, value);
|
return process(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSlot(const QString &name, const Value *value)
|
bool processSlot(const QString &name, const Value *value) override
|
||||||
{
|
{
|
||||||
return process(name, value);
|
return process(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processGeneratedSlot(const QString &name, const Value *value)
|
bool processGeneratedSlot(const QString &name, const Value *value) override
|
||||||
{
|
{
|
||||||
return process(name, value);
|
return process(name, value);
|
||||||
}
|
}
|
||||||
@@ -2574,31 +2574,31 @@ class MemberDumper: public MemberProcessor
|
|||||||
public:
|
public:
|
||||||
MemberDumper() {}
|
MemberDumper() {}
|
||||||
|
|
||||||
virtual bool processProperty(const QString &name, const Value *, const PropertyInfo &pInfo)
|
bool processProperty(const QString &name, const Value *, const PropertyInfo &pInfo) override
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "property: " << name << " flags:" << pInfo.toString();
|
qCDebug(qmljsLog) << "property: " << name << " flags:" << pInfo.toString();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processEnumerator(const QString &name, const Value *)
|
bool processEnumerator(const QString &name, const Value *) override
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "enumerator: " << name;
|
qCDebug(qmljsLog) << "enumerator: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSignal(const QString &name, const Value *)
|
bool processSignal(const QString &name, const Value *) override
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "signal: " << name;
|
qCDebug(qmljsLog) << "signal: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processSlot(const QString &name, const Value *)
|
bool processSlot(const QString &name, const Value *) override
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "slot: " << name;
|
qCDebug(qmljsLog) << "slot: " << name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool processGeneratedSlot(const QString &name, const Value *)
|
bool processGeneratedSlot(const QString &name, const Value *) override
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "generated slot: " << name;
|
qCDebug(qmljsLog) << "generated slot: " << name;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ protected:
|
|||||||
BlockData data;
|
BlockData data;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void saveBlockData(QTextBlock *block, const BlockData &data) const
|
void saveBlockData(QTextBlock *block, const BlockData &data) const override
|
||||||
{
|
{
|
||||||
block->setUserData(new FormatterData(data));
|
block->setUserData(new FormatterData(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool loadBlockData(const QTextBlock &block, BlockData *data) const
|
bool loadBlockData(const QTextBlock &block, BlockData *data) const override
|
||||||
{
|
{
|
||||||
if (!block.userData())
|
if (!block.userData())
|
||||||
return false;
|
return false;
|
||||||
@@ -67,12 +67,12 @@ protected:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void saveLexerState(QTextBlock *block, int state) const
|
void saveLexerState(QTextBlock *block, int state) const override
|
||||||
{
|
{
|
||||||
block->setUserState(state);
|
block->setUserState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int loadLexerState(const QTextBlock &block) const
|
int loadLexerState(const QTextBlock &block) const override
|
||||||
{
|
{
|
||||||
return block.userState();
|
return block.userState();
|
||||||
}
|
}
|
||||||
@@ -464,7 +464,7 @@ protected:
|
|||||||
loc.length += 2;
|
loc.length += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool preVisit(Node *ast)
|
bool preVisit(Node *ast) override
|
||||||
{
|
{
|
||||||
SourceLocation firstLoc;
|
SourceLocation firstLoc;
|
||||||
if (ExpressionNode *expr = ast->expressionCast())
|
if (ExpressionNode *expr = ast->expressionCast())
|
||||||
@@ -486,7 +486,7 @@ protected:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void postVisit(Node *ast)
|
void postVisit(Node *ast) override
|
||||||
{
|
{
|
||||||
SourceLocation lastLoc;
|
SourceLocation lastLoc;
|
||||||
if (ExpressionNode *expr = ast->expressionCast())
|
if (ExpressionNode *expr = ast->expressionCast())
|
||||||
@@ -525,14 +525,14 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiPragma *ast)
|
bool visit(UiPragma *ast) override
|
||||||
{
|
{
|
||||||
out("pragma ", ast->pragmaToken);
|
out("pragma ", ast->pragmaToken);
|
||||||
accept(ast->pragmaType);
|
accept(ast->pragmaType);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiImport *ast)
|
bool visit(UiImport *ast) override
|
||||||
{
|
{
|
||||||
out("import ", ast->importToken);
|
out("import ", ast->importToken);
|
||||||
if (!ast->fileName.isNull())
|
if (!ast->fileName.isNull())
|
||||||
@@ -550,7 +550,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiObjectDefinition *ast)
|
bool visit(UiObjectDefinition *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->qualifiedTypeNameId);
|
accept(ast->qualifiedTypeNameId);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -558,7 +558,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiObjectInitializer *ast)
|
bool visit(UiObjectInitializer *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lbraceToken);
|
out(ast->lbraceToken);
|
||||||
if (ast->members)
|
if (ast->members)
|
||||||
@@ -568,7 +568,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiParameterList *list)
|
bool visit(UiParameterList *list) override
|
||||||
{
|
{
|
||||||
for (UiParameterList *it = list; it; it = it->next) {
|
for (UiParameterList *it = list; it; it = it->next) {
|
||||||
out(it->propertyTypeToken);
|
out(it->propertyTypeToken);
|
||||||
@@ -580,7 +580,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiPublicMember *ast)
|
bool visit(UiPublicMember *ast) override
|
||||||
{
|
{
|
||||||
if (ast->type == UiPublicMember::Property) {
|
if (ast->type == UiPublicMember::Property) {
|
||||||
if (ast->isDefaultMember)
|
if (ast->isDefaultMember)
|
||||||
@@ -618,7 +618,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiObjectBinding *ast)
|
bool visit(UiObjectBinding *ast) override
|
||||||
{
|
{
|
||||||
if (ast->hasOnToken) {
|
if (ast->hasOnToken) {
|
||||||
accept(ast->qualifiedTypeNameId);
|
accept(ast->qualifiedTypeNameId);
|
||||||
@@ -634,7 +634,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiScriptBinding *ast)
|
bool visit(UiScriptBinding *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->qualifiedId);
|
accept(ast->qualifiedId);
|
||||||
out(": ", ast->colonToken);
|
out(": ", ast->colonToken);
|
||||||
@@ -642,7 +642,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiArrayBinding *ast)
|
bool visit(UiArrayBinding *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->qualifiedId);
|
accept(ast->qualifiedId);
|
||||||
out(ast->colonToken);
|
out(ast->colonToken);
|
||||||
@@ -654,16 +654,16 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ThisExpression *ast) { out(ast->thisToken); return true; }
|
bool visit(ThisExpression *ast) override { out(ast->thisToken); return true; }
|
||||||
virtual bool visit(NullExpression *ast) { out(ast->nullToken); return true; }
|
bool visit(NullExpression *ast) override { out(ast->nullToken); return true; }
|
||||||
virtual bool visit(TrueLiteral *ast) { out(ast->trueToken); return true; }
|
bool visit(TrueLiteral *ast) override { out(ast->trueToken); return true; }
|
||||||
virtual bool visit(FalseLiteral *ast) { out(ast->falseToken); return true; }
|
bool visit(FalseLiteral *ast) override { out(ast->falseToken); return true; }
|
||||||
virtual bool visit(IdentifierExpression *ast) { out(ast->identifierToken); return true; }
|
bool visit(IdentifierExpression *ast) override { out(ast->identifierToken); return true; }
|
||||||
virtual bool visit(StringLiteral *ast) { out(ast->literalToken); return true; }
|
bool visit(StringLiteral *ast) override { out(ast->literalToken); return true; }
|
||||||
virtual bool visit(NumericLiteral *ast) { out(ast->literalToken); return true; }
|
bool visit(NumericLiteral *ast) override { out(ast->literalToken); return true; }
|
||||||
virtual bool visit(RegExpLiteral *ast) { out(ast->literalToken); return true; }
|
bool visit(RegExpLiteral *ast) override { out(ast->literalToken); return true; }
|
||||||
|
|
||||||
virtual bool visit(ArrayLiteral *ast)
|
bool visit(ArrayLiteral *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lbracketToken);
|
out(ast->lbracketToken);
|
||||||
if (ast->elements)
|
if (ast->elements)
|
||||||
@@ -676,7 +676,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ObjectLiteral *ast)
|
bool visit(ObjectLiteral *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lbraceToken);
|
out(ast->lbraceToken);
|
||||||
lnAcceptIndented(ast->properties);
|
lnAcceptIndented(ast->properties);
|
||||||
@@ -685,7 +685,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ElementList *ast)
|
bool visit(ElementList *ast) override
|
||||||
{
|
{
|
||||||
for (ElementList *it = ast; it; it = it->next) {
|
for (ElementList *it = ast; it; it = it->next) {
|
||||||
if (it->elision)
|
if (it->elision)
|
||||||
@@ -700,7 +700,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(PropertyAssignmentList *ast)
|
bool visit(PropertyAssignmentList *ast) override
|
||||||
{
|
{
|
||||||
for (PropertyAssignmentList *it = ast; it; it = it->next) {
|
for (PropertyAssignmentList *it = ast; it; it = it->next) {
|
||||||
PropertyNameAndValue *assignment = AST::cast<PropertyNameAndValue *>(it->assignment);
|
PropertyNameAndValue *assignment = AST::cast<PropertyNameAndValue *>(it->assignment);
|
||||||
@@ -739,7 +739,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(NestedExpression *ast)
|
bool visit(NestedExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lparenToken);
|
out(ast->lparenToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
@@ -747,11 +747,11 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(IdentifierPropertyName *ast) { out(ast->id.toString()); return true; }
|
bool visit(IdentifierPropertyName *ast) override { out(ast->id.toString()); return true; }
|
||||||
virtual bool visit(StringLiteralPropertyName *ast) { out(ast->id.toString()); return true; }
|
bool visit(StringLiteralPropertyName *ast) override { out(ast->id.toString()); return true; }
|
||||||
virtual bool visit(NumericLiteralPropertyName *ast) { out(QString::number(ast->id)); return true; }
|
bool visit(NumericLiteralPropertyName *ast) override { out(QString::number(ast->id)); return true; }
|
||||||
|
|
||||||
virtual bool visit(ArrayMemberExpression *ast)
|
bool visit(ArrayMemberExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
out(ast->lbracketToken);
|
out(ast->lbracketToken);
|
||||||
@@ -760,7 +760,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(FieldMemberExpression *ast)
|
bool visit(FieldMemberExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
out(ast->dotToken);
|
out(ast->dotToken);
|
||||||
@@ -768,7 +768,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(NewMemberExpression *ast)
|
bool visit(NewMemberExpression *ast) override
|
||||||
{
|
{
|
||||||
out("new ", ast->newToken);
|
out("new ", ast->newToken);
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
@@ -778,14 +778,14 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(NewExpression *ast)
|
bool visit(NewExpression *ast) override
|
||||||
{
|
{
|
||||||
out("new ", ast->newToken);
|
out("new ", ast->newToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(CallExpression *ast)
|
bool visit(CallExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
out(ast->lparenToken);
|
out(ast->lparenToken);
|
||||||
@@ -795,84 +795,84 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(PostIncrementExpression *ast)
|
bool visit(PostIncrementExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
out(ast->incrementToken);
|
out(ast->incrementToken);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(PostDecrementExpression *ast)
|
bool visit(PostDecrementExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
out(ast->decrementToken);
|
out(ast->decrementToken);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(PreIncrementExpression *ast)
|
bool visit(PreIncrementExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->incrementToken);
|
out(ast->incrementToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(PreDecrementExpression *ast)
|
bool visit(PreDecrementExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->decrementToken);
|
out(ast->decrementToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(DeleteExpression *ast)
|
bool visit(DeleteExpression *ast) override
|
||||||
{
|
{
|
||||||
out("delete ", ast->deleteToken);
|
out("delete ", ast->deleteToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(VoidExpression *ast)
|
bool visit(VoidExpression *ast) override
|
||||||
{
|
{
|
||||||
out("void ", ast->voidToken);
|
out("void ", ast->voidToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(TypeOfExpression *ast)
|
bool visit(TypeOfExpression *ast) override
|
||||||
{
|
{
|
||||||
out("typeof ", ast->typeofToken);
|
out("typeof ", ast->typeofToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UnaryPlusExpression *ast)
|
bool visit(UnaryPlusExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->plusToken);
|
out(ast->plusToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UnaryMinusExpression *ast)
|
bool visit(UnaryMinusExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->minusToken);
|
out(ast->minusToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(TildeExpression *ast)
|
bool visit(TildeExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->tildeToken);
|
out(ast->tildeToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(NotExpression *ast)
|
bool visit(NotExpression *ast) override
|
||||||
{
|
{
|
||||||
out(ast->notToken);
|
out(ast->notToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(BinaryExpression *ast)
|
bool visit(BinaryExpression *ast) override
|
||||||
{
|
{
|
||||||
++_binaryExpDepth;
|
++_binaryExpDepth;
|
||||||
accept(ast->left);
|
accept(ast->left);
|
||||||
@@ -893,7 +893,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ConditionalExpression *ast)
|
bool visit(ConditionalExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
out(" ? ", ast->questionToken);
|
out(" ? ", ast->questionToken);
|
||||||
@@ -903,7 +903,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(Block *ast)
|
bool visit(Block *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lbraceToken);
|
out(ast->lbraceToken);
|
||||||
lnAcceptIndented(ast->statements);
|
lnAcceptIndented(ast->statements);
|
||||||
@@ -912,14 +912,14 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(VariableStatement *ast)
|
bool visit(VariableStatement *ast) override
|
||||||
{
|
{
|
||||||
out("var ", ast->declarationKindToken);
|
out("var ", ast->declarationKindToken);
|
||||||
accept(ast->declarations);
|
accept(ast->declarations);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(VariableDeclaration *ast)
|
bool visit(VariableDeclaration *ast) override
|
||||||
{
|
{
|
||||||
out(ast->identifierToken);
|
out(ast->identifierToken);
|
||||||
if (ast->expression) {
|
if (ast->expression) {
|
||||||
@@ -929,13 +929,13 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(EmptyStatement *ast)
|
bool visit(EmptyStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->semicolonToken);
|
out(ast->semicolonToken);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(IfStatement *ast)
|
bool visit(IfStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->ifToken);
|
out(ast->ifToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -955,7 +955,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(DoWhileStatement *ast)
|
bool visit(DoWhileStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->doToken);
|
out(ast->doToken);
|
||||||
acceptBlockOrIndented(ast->statement, true);
|
acceptBlockOrIndented(ast->statement, true);
|
||||||
@@ -967,7 +967,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(WhileStatement *ast)
|
bool visit(WhileStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->whileToken);
|
out(ast->whileToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -978,7 +978,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ForStatement *ast)
|
bool visit(ForStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->forToken);
|
out(ast->forToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -993,7 +993,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(LocalForStatement *ast)
|
bool visit(LocalForStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->forToken);
|
out(ast->forToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1010,7 +1010,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ForEachStatement *ast)
|
bool visit(ForEachStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->forToken);
|
out(ast->forToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1023,7 +1023,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(LocalForEachStatement *ast)
|
bool visit(LocalForEachStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->forToken);
|
out(ast->forToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1038,7 +1038,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ContinueStatement *ast)
|
bool visit(ContinueStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->continueToken);
|
out(ast->continueToken);
|
||||||
if (!ast->label.isNull()) {
|
if (!ast->label.isNull()) {
|
||||||
@@ -1048,7 +1048,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(BreakStatement *ast)
|
bool visit(BreakStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->breakToken);
|
out(ast->breakToken);
|
||||||
if (!ast->label.isNull()) {
|
if (!ast->label.isNull()) {
|
||||||
@@ -1058,7 +1058,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ReturnStatement *ast)
|
bool visit(ReturnStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->returnToken);
|
out(ast->returnToken);
|
||||||
if (ast->expression) {
|
if (ast->expression) {
|
||||||
@@ -1068,7 +1068,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ThrowStatement *ast)
|
bool visit(ThrowStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->throwToken);
|
out(ast->throwToken);
|
||||||
if (ast->expression) {
|
if (ast->expression) {
|
||||||
@@ -1078,7 +1078,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(WithStatement *ast)
|
bool visit(WithStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->withToken);
|
out(ast->withToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1089,7 +1089,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(SwitchStatement *ast)
|
bool visit(SwitchStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->switchToken);
|
out(ast->switchToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1101,7 +1101,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(CaseBlock *ast)
|
bool visit(CaseBlock *ast) override
|
||||||
{
|
{
|
||||||
out(ast->lbraceToken);
|
out(ast->lbraceToken);
|
||||||
newLine();
|
newLine();
|
||||||
@@ -1117,7 +1117,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(CaseClause *ast)
|
bool visit(CaseClause *ast) override
|
||||||
{
|
{
|
||||||
out("case ", ast->caseToken);
|
out("case ", ast->caseToken);
|
||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
@@ -1127,7 +1127,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(DefaultClause *ast)
|
bool visit(DefaultClause *ast) override
|
||||||
{
|
{
|
||||||
out(ast->defaultToken);
|
out(ast->defaultToken);
|
||||||
out(ast->colonToken);
|
out(ast->colonToken);
|
||||||
@@ -1135,7 +1135,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(LabelledStatement *ast)
|
bool visit(LabelledStatement *ast) override
|
||||||
{
|
{
|
||||||
out(ast->identifierToken);
|
out(ast->identifierToken);
|
||||||
out(": ", ast->colonToken);
|
out(": ", ast->colonToken);
|
||||||
@@ -1143,7 +1143,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(TryStatement *ast)
|
bool visit(TryStatement *ast) override
|
||||||
{
|
{
|
||||||
out("try ", ast->tryToken);
|
out("try ", ast->tryToken);
|
||||||
accept(ast->statement);
|
accept(ast->statement);
|
||||||
@@ -1158,7 +1158,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(Catch *ast)
|
bool visit(Catch *ast) override
|
||||||
{
|
{
|
||||||
out(ast->catchToken);
|
out(ast->catchToken);
|
||||||
out(" ");
|
out(" ");
|
||||||
@@ -1169,19 +1169,19 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(Finally *ast)
|
bool visit(Finally *ast) override
|
||||||
{
|
{
|
||||||
out("finally ", ast->finallyToken);
|
out("finally ", ast->finallyToken);
|
||||||
accept(ast->statement);
|
accept(ast->statement);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(FunctionDeclaration *ast)
|
bool visit(FunctionDeclaration *ast) override
|
||||||
{
|
{
|
||||||
return visit(static_cast<FunctionExpression *>(ast));
|
return visit(static_cast<FunctionExpression *>(ast));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(FunctionExpression *ast)
|
bool visit(FunctionExpression *ast) override
|
||||||
{
|
{
|
||||||
out("function ", ast->functionToken);
|
out("function ", ast->functionToken);
|
||||||
if (!ast->name.isNull())
|
if (!ast->name.isNull())
|
||||||
@@ -1200,7 +1200,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual bool visit(UiHeaderItemList *ast)
|
bool visit(UiHeaderItemList *ast) override
|
||||||
{
|
{
|
||||||
for (UiHeaderItemList *it = ast; it; it = it->next) {
|
for (UiHeaderItemList *it = ast; it; it = it->next) {
|
||||||
accept(it->headerItem);
|
accept(it->headerItem);
|
||||||
@@ -1210,7 +1210,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiObjectMemberList *ast)
|
bool visit(UiObjectMemberList *ast) override
|
||||||
{
|
{
|
||||||
for (UiObjectMemberList *it = ast; it; it = it->next) {
|
for (UiObjectMemberList *it = ast; it; it = it->next) {
|
||||||
accept(it->member);
|
accept(it->member);
|
||||||
@@ -1220,7 +1220,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiArrayMemberList *ast)
|
bool visit(UiArrayMemberList *ast) override
|
||||||
{
|
{
|
||||||
for (UiArrayMemberList *it = ast; it; it = it->next) {
|
for (UiArrayMemberList *it = ast; it; it = it->next) {
|
||||||
accept(it->member);
|
accept(it->member);
|
||||||
@@ -1232,7 +1232,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiQualifiedId *ast)
|
bool visit(UiQualifiedId *ast) override
|
||||||
{
|
{
|
||||||
for (UiQualifiedId *it = ast; it; it = it->next) {
|
for (UiQualifiedId *it = ast; it; it = it->next) {
|
||||||
out(it->identifierToken);
|
out(it->identifierToken);
|
||||||
@@ -1242,13 +1242,13 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(UiQualifiedPragmaId *ast)
|
bool visit(UiQualifiedPragmaId *ast) override
|
||||||
{
|
{
|
||||||
out(ast->identifierToken);
|
out(ast->identifierToken);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(Elision *ast)
|
bool visit(Elision *ast) override
|
||||||
{
|
{
|
||||||
for (Elision *it = ast; it; it = it->next) {
|
for (Elision *it = ast; it; it = it->next) {
|
||||||
if (it->next)
|
if (it->next)
|
||||||
@@ -1257,7 +1257,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(ArgumentList *ast)
|
bool visit(ArgumentList *ast) override
|
||||||
{
|
{
|
||||||
for (ArgumentList *it = ast; it; it = it->next) {
|
for (ArgumentList *it = ast; it; it = it->next) {
|
||||||
accept(it->expression);
|
accept(it->expression);
|
||||||
@@ -1269,7 +1269,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(StatementList *ast)
|
bool visit(StatementList *ast) override
|
||||||
{
|
{
|
||||||
for (StatementList *it = ast; it; it = it->next) {
|
for (StatementList *it = ast; it; it = it->next) {
|
||||||
// ### work around parser bug: skip empty statements with wrong tokens
|
// ### work around parser bug: skip empty statements with wrong tokens
|
||||||
@@ -1285,7 +1285,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(SourceElements *ast)
|
bool visit(SourceElements *ast) override
|
||||||
{
|
{
|
||||||
for (SourceElements *it = ast; it; it = it->next) {
|
for (SourceElements *it = ast; it; it = it->next) {
|
||||||
accept(it->element);
|
accept(it->element);
|
||||||
@@ -1295,7 +1295,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(VariableDeclarationList *ast)
|
bool visit(VariableDeclarationList *ast) override
|
||||||
{
|
{
|
||||||
for (VariableDeclarationList *it = ast; it; it = it->next) {
|
for (VariableDeclarationList *it = ast; it; it = it->next) {
|
||||||
accept(it->declaration);
|
accept(it->declaration);
|
||||||
@@ -1305,7 +1305,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(CaseClauses *ast)
|
bool visit(CaseClauses *ast) override
|
||||||
{
|
{
|
||||||
for (CaseClauses *it = ast; it; it = it->next) {
|
for (CaseClauses *it = ast; it; it = it->next) {
|
||||||
accept(it->clause);
|
accept(it->clause);
|
||||||
@@ -1315,7 +1315,7 @@ protected:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(FormalParameterList *ast)
|
bool visit(FormalParameterList *ast) override
|
||||||
{
|
{
|
||||||
for (FormalParameterList *it = ast; it; it = it->next) {
|
for (FormalParameterList *it = ast; it; it = it->next) {
|
||||||
if (it->commaToken.isValid())
|
if (it->commaToken.isValid())
|
||||||
|
|||||||
Reference in New Issue
Block a user