diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2011-02-23 20:32:21 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2011-02-23 20:32:21 (GMT) |
commit | c881e33e7e510204fabd061dac08a00b10b432fb (patch) | |
tree | b5a5210eef8d309a17aca7d20b457879b584913f /tools/qdoc3/qmlcodemarker.cpp | |
parent | 309c48a70b46678ef92da441fcc2dc96ceb8fcf3 (diff) | |
parent | 3c982b5d214cc7a37ace1d956ac8fb0b9a281722 (diff) | |
download | Qt-c881e33e7e510204fabd061dac08a00b10b432fb.zip Qt-c881e33e7e510204fabd061dac08a00b10b432fb.tar.gz Qt-c881e33e7e510204fabd061dac08a00b10b432fb.tar.bz2 |
Merge branch '4.7' into mimir
Diffstat (limited to 'tools/qdoc3/qmlcodemarker.cpp')
-rw-r--r-- | tools/qdoc3/qmlcodemarker.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/qdoc3/qmlcodemarker.cpp b/tools/qdoc3/qmlcodemarker.cpp index 1e4ad1e..a7dc5a0 100644 --- a/tools/qdoc3/qmlcodemarker.cpp +++ b/tools/qdoc3/qmlcodemarker.cpp @@ -103,6 +103,14 @@ bool QmlCodeMarker::recognizeLanguage(const QString &language) } /*! + Returns the type of atom used to represent QML code in the documentation. +*/ +Atom::Type QmlCodeMarker::atomType() const +{ + return Atom::Qml; +} + +/*! Returns the name of the \a node. Method names include are returned with a trailing set of parentheses. */ @@ -134,9 +142,9 @@ QString QmlCodeMarker::plainFullName(const Node *node, const Node *relative) QString QmlCodeMarker::markedUpCode(const QString &code, const Node *relative, - const QString &dirPath) + const Location &location) { - return addMarkUp(code, relative, dirPath); + return addMarkUp(code, relative, location); } QString QmlCodeMarker::markedUpName(const Node *node) @@ -174,7 +182,8 @@ QString QmlCodeMarker::markedUpIncludes(const QStringList& includes) code += "import " + *inc + "\n"; ++inc; } - return protect(addMarkUp(code, 0, "")); + Location location; + return addMarkUp(code, 0, location); } QString QmlCodeMarker::functionBeginRegExp(const QString& funcName) @@ -190,7 +199,7 @@ QString QmlCodeMarker::functionEndRegExp(const QString& /* funcName */) QString QmlCodeMarker::addMarkUp(const QString &code, const Node * /* relative */, - const QString & /* dirPath */) + const Location &location) { QDeclarativeJS::Engine engine; QDeclarativeJS::Lexer lexer(&engine); @@ -210,7 +219,13 @@ QString QmlCodeMarker::addMarkUp(const QString &code, QmlMarkupVisitor visitor(code, pragmas, &engine); QDeclarativeJS::AST::Node::accept(ast, &visitor); output = visitor.markedUpCode(); + } else { + location.warning(tr("Unable to parse QML: \"%1\" at line %2, column %3").arg( + parser.errorMessage()).arg(parser.errorLineNumber()).arg( + parser.errorColumnNumber())); + output = protect(code); } + return output; } |