diff options
Diffstat (limited to 'src/tools/qdoc/qmlparser')
-rw-r--r-- | src/tools/qdoc/qmlparser/qqmljsastfwd_p.h | 45 | ||||
-rw-r--r-- | src/tools/qdoc/qmlparser/qqmljsengine_p.cpp | 2 | ||||
-rw-r--r-- | src/tools/qdoc/qmlparser/qqmljsengine_p.h | 6 |
3 files changed, 28 insertions, 25 deletions
diff --git a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h index eae4125ab25..bfaa4401d23 100644 --- a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h @@ -37,6 +37,7 @@ #include "qqmljsglobal_p.h" #include <QtCore/qglobal.h> +#include <QtCore/qtypeinfo.h> // // W A R N I N G @@ -53,27 +54,6 @@ QT_QML_BEGIN_NAMESPACE namespace QQmlJS { namespace AST { -class SourceLocation -{ -public: - explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0) - : offset(offset), length(length), - startLine(line), startColumn(column) - { } - - bool isValid() const { return length != 0; } - - quint32 begin() const { return offset; } - quint32 end() const { return offset + length; } - -// attributes - // ### encode - quint32 offset; - quint32 length; - quint32 startLine; - quint32 startColumn; -}; - class Visitor; class Node; class ExpressionNode; @@ -176,8 +156,31 @@ class UiQualifiedId; class UiQualifiedPragmaId; class UiHeaderItemList; +class SourceLocation +{ +public: + explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0) + : offset(offset), length(length), + startLine(line), startColumn(column) + { } + + bool isValid() const { return length != 0; } + + quint32 begin() const { return offset; } + quint32 end() const { return offset + length; } + +// attributes + // ### encode + quint32 offset; + quint32 length; + quint32 startLine; + quint32 startColumn; +}; + } } // namespace AST +Q_DECLARE_TYPEINFO(QQmlJS::AST::SourceLocation, Q_PRIMITIVE_TYPE); + QT_QML_END_NAMESPACE #endif diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp index 4e130517304..2a949b630c6 100644 --- a/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp +++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.cpp @@ -125,7 +125,7 @@ void Engine::setCode(const QString &code) void Engine::addComment(int pos, int len, int line, int col) { if (len > 0) _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col)); } -QList<QQmlJS::AST::SourceLocation> Engine::comments() const +QVector<QQmlJS::AST::SourceLocation> Engine::comments() const { return _comments; } Lexer *Engine::lexer() const diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.h b/src/tools/qdoc/qmlparser/qqmljsengine_p.h index fb65d7f028b..9ab26f0d0f1 100644 --- a/src/tools/qdoc/qmlparser/qqmljsengine_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.h @@ -50,7 +50,7 @@ #include "qqmljsmemorypool_p.h" #include <QtCore/qstring.h> -#include <QtCore/qset.h> +#include <QtCore/qvector.h> QT_QML_BEGIN_NAMESPACE @@ -87,7 +87,7 @@ class QML_PARSER_EXPORT Engine Lexer *_lexer; Directives *_directives; MemoryPool _pool; - QList<AST::SourceLocation> _comments; + QVector<AST::SourceLocation> _comments; QString _extraCode; QString _code; @@ -99,7 +99,7 @@ public: const QString &code() const { return _code; } void addComment(int pos, int len, int line, int col); - QList<AST::SourceLocation> comments() const; + QVector<AST::SourceLocation> comments() const; Lexer *lexer() const; void setLexer(Lexer *lexer); |