summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/jscodemarker.cpp
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@nokia.com>2011-01-05 10:41:57 (GMT)
committerJerome Pasion <jerome.pasion@nokia.com>2011-01-05 10:41:57 (GMT)
commit55d05512939b8e7a43f22a1cc423112d8fb3d2eb (patch)
tree5cb44bd6883fe8da180378fe7416d5b1514f6578 /tools/qdoc3/jscodemarker.cpp
parent9b0ad342cc888bd4291c84f63fe485bfbfdc3ce0 (diff)
parentf44f7084a3020ed8e249644d5b5e07f74cb7b070 (diff)
downloadQt-55d05512939b8e7a43f22a1cc423112d8fb3d2eb.zip
Qt-55d05512939b8e7a43f22a1cc423112d8fb3d2eb.tar.gz
Qt-55d05512939b8e7a43f22a1cc423112d8fb3d2eb.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Merging qt-doc-team into cloned repository
Diffstat (limited to 'tools/qdoc3/jscodemarker.cpp')
-rw-r--r--tools/qdoc3/jscodemarker.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/qdoc3/jscodemarker.cpp b/tools/qdoc3/jscodemarker.cpp
index 84a28c6..80df0aa 100644
--- a/tools/qdoc3/jscodemarker.cpp
+++ b/tools/qdoc3/jscodemarker.cpp
@@ -103,14 +103,14 @@ bool JsCodeMarker::recognizeLanguage(const QString &language)
QString JsCodeMarker::markedUpCode(const QString &code,
const Node *relative,
- const QString &dirPath)
+ const Location &location)
{
- return addMarkUp(code, relative, dirPath);
+ return addMarkUp(code, relative, location);
}
QString JsCodeMarker::addMarkUp(const QString &code,
const Node * /* relative */,
- const QString & /* dirPath */)
+ const Location &location)
{
QDeclarativeJS::Engine engine;
QDeclarativeJS::Lexer lexer(&engine);
@@ -130,7 +130,13 @@ QString JsCodeMarker::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 JavaScript: \"%1\" at line %2, column %3").arg(
+ parser.errorMessage()).arg(parser.errorLineNumber()).arg(
+ parser.errorColumnNumber()));
+ output = protect(code);
}
+
return output;
}