aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@qt.io>2020-02-11 16:22:12 +0100
committerFawzi Mohamed <fawzi.mohamed@qt.io>2020-02-12 18:28:17 +0100
commitc2e756dc1962eeb3575f618b38272359d4fccc89 (patch)
treea4848574d0e2b341f15256b8099d6404549f6396 /tests/auto/shared
parent7f7bf177f41d7824aecee9f046a8a63ef4d82521 (diff)
Introduce BaseVisitor
Base Visitor is an abstract visitor that has all visit methods abstract, subclassing this one gets an error if some visit method is not implemented (dumper and reformatter for example will gain from this. Change-Id: I3f8cfeb6fc0ef917acf725bbe1c293d761304287 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/shared')
-rw-r--r--tests/auto/shared/qqmljsastdumper.cpp7
-rw-r--r--tests/auto/shared/qqmljsastdumper.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/shared/qqmljsastdumper.cpp b/tests/auto/shared/qqmljsastdumper.cpp
index 7c7485fd1f..92d95be80a 100644
--- a/tests/auto/shared/qqmljsastdumper.cpp
+++ b/tests/auto/shared/qqmljsastdumper.cpp
@@ -366,6 +366,12 @@ bool AstDumper::visit(UiRequired *el)
return true;
}
+bool AstDumper::visit(UiAnnotationList *)
+{
+ start(QLatin1String("UiAnnotationList"));
+ return true;
+}
+
void AstDumper::endVisit(AST::UiProgram *) { stop("UiProgram"); }
void AstDumper::endVisit(AST::UiImport *el) {
@@ -403,6 +409,7 @@ void AstDumper::endVisit(AST::UiEnumMemberList *el) {
void AstDumper::endVisit(AST::UiVersionSpecifier *) { stop("UiVersionSpecifier"); }
void AstDumper::endVisit(AST::UiInlineComponent *) { stop("UiInlineComponent"); }
void AstDumper::endVisit(UiRequired *) { stop("UiRequired"); }
+void AstDumper::endVisit(UiAnnotationList *) { stop("UiAnnotationList"); }
// QQmlJS
bool AstDumper::visit(AST::ThisExpression *el) {
diff --git a/tests/auto/shared/qqmljsastdumper.h b/tests/auto/shared/qqmljsastdumper.h
index 919b80f38c..cd52e96220 100644
--- a/tests/auto/shared/qqmljsastdumper.h
+++ b/tests/auto/shared/qqmljsastdumper.h
@@ -71,7 +71,7 @@ bool operator & (DumperOptions lhs, DumperOptions rhs);
DumperOptions operator | (DumperOptions lhs, DumperOptions rhs);
// no export, currently just a supporting file...
-class AstDumper: public AST::Visitor
+class AstDumper: public AST::BaseVisitor
{
public:
static QString printNode2(AST::Node *);