1 | // Copyright (C) 2020 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQMLDOMASTDUMPER_P_H |
5 | #define QQMLDOMASTDUMPER_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include "qqmldom_global.h" |
19 | #include "qqmldomconstants_p.h" |
20 | #include "qqmldomstringdumper_p.h" |
21 | |
22 | #include <QtQml/private/qqmljsglobal_p.h> |
23 | #include <QtQml/private/qqmljsastvisitor_p.h> |
24 | #include <QtCore/QString> |
25 | |
26 | QT_BEGIN_NAMESPACE |
27 | class QDebug; |
28 | |
29 | namespace QQmlJS { |
30 | namespace Dom { |
31 | |
32 | inline QStringView noStr(SourceLocation) |
33 | { |
34 | return QStringView(); |
35 | } |
36 | |
37 | QMLDOM_EXPORT QString lineDiff(QString s1, QString s2, int nContext); |
38 | QMLDOM_EXPORT QString astNodeDiff(AST::Node *n1, AST::Node *n2, int nContext = 3, |
39 | AstDumperOptions opt = AstDumperOption::None, int indent = 0, |
40 | function_ref<QStringView(SourceLocation)> loc2str1 = noStr, |
41 | function_ref<QStringView(SourceLocation)> loc2str2 = noStr); |
42 | QMLDOM_EXPORT void astNodeDumper(Sink s, AST::Node *n, AstDumperOptions opt = AstDumperOption::None, |
43 | int indent = 1, int baseIndent = 0, |
44 | function_ref<QStringView(SourceLocation)> loc2str = noStr); |
45 | QMLDOM_EXPORT QString astNodeDump(AST::Node *n, AstDumperOptions opt = AstDumperOption::None, |
46 | int indent = 1, int baseIndent = 0, |
47 | function_ref<QStringView(SourceLocation)> loc2str = noStr); |
48 | |
49 | QMLDOM_EXPORT QDebug operator<<(QDebug d, AST::Node *n); |
50 | |
51 | } // namespace Dom |
52 | } // namespace AST |
53 | |
54 | QT_END_NAMESPACE |
55 | |
56 | #endif // QQMLDOMASTDUMPER_P_H |
57 | |