qdoc: Fixed qdoc error messages
authorMartin Smith <martin.smith@nokia.com>
Tue, 8 May 2012 11:13:14 +0000 (13:13 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 9 May 2012 00:28:44 +0000 (02:28 +0200)
qdoc prints many error messages without including the
source file path and the line number for where the error
occurs. This makes it difficult to find the place to
fix the error. This update corrects some of those error
messages. Further updates will fix the others.

Change-Id: I9c0eed96482c61643a2d83c5135368413e63ae52
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/codeparser.cpp
src/tools/qdoc/codeparser.h
src/tools/qdoc/cppcodeparser.cpp
src/tools/qdoc/cppcodeparser.h
src/tools/qdoc/ditaxmlgenerator.cpp
src/tools/qdoc/doc.cpp
src/tools/qdoc/doc.h
src/tools/qdoc/htmlgenerator.cpp
src/tools/qdoc/node.cpp
src/tools/qdoc/node.h
src/tools/qdoc/qmlvisitor.cpp

index f06cc1f..1d0c486 100644 (file)
@@ -229,7 +229,7 @@ QSet<QString> CodeParser::commonMetaCommands()
  */
 void CodeParser::processCommonMetaCommand(const Location& location,
                                           const QString& command,
-                                          const QString& arg,
+                                          const ArgLocPair& arg,
                                           Node* node,
                                           Tree* tree)
 {
@@ -241,13 +241,13 @@ void CodeParser::processCommonMetaCommand(const Location& location,
         node->setStatus(Node::Deprecated);
     }
     else if (command == COMMAND_INGROUP) {
-        tree->addToGroup(node, arg);
+        tree->addToGroup(node, arg.first);
     }
     else if (command == COMMAND_INPUBLICGROUP) {
-        tree->addToPublicGroup(node, arg);
+        tree->addToPublicGroup(node, arg.first);
     }
     else if (command == COMMAND_INMODULE) {
-        node->setModuleName(arg);
+        node->setModuleName(arg.first);
     }
     else if (command == COMMAND_INQMLMODULE) {
         node->setQmlModule(arg);
@@ -280,15 +280,15 @@ void CodeParser::processCommonMetaCommand(const Location& location,
         node->setThreadSafeness(Node::Reentrant);
     }
     else if (command == COMMAND_SINCE) {
-        node->setSince(arg);
+        node->setSince(arg.first);
     }
     else if (command == COMMAND_PAGEKEYWORDS) {
-        node->addPageKeywords(arg);
+        node->addPageKeywords(arg.first);
     }
     else if (command == COMMAND_SUBTITLE) {
         if (node->type() == Node::Fake) {
             FakeNode *fake = static_cast<FakeNode *>(node);
-            fake->setSubTitle(arg);
+            fake->setSubTitle(arg.first);
         }
         else
             location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
@@ -299,11 +299,11 @@ void CodeParser::processCommonMetaCommand(const Location& location,
     else if (command == COMMAND_TITLE) {
         if (node->type() == Node::Fake) {
             FakeNode *fake = static_cast<FakeNode *>(node);
-            fake->setTitle(arg);
+            fake->setTitle(arg.first);
             if (fake->subType() == Node::Example) {
                 ExampleNode::exampleNodeMap.insert(fake->title(),static_cast<ExampleNode*>(fake));
             }
-            nameToTitle.insert(fake->name(),arg);
+            nameToTitle.insert(fake->name(),arg.first);
         }
         else
             location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
index f522567..c4429ff 100644 (file)
@@ -89,7 +89,8 @@ public:
 protected:
     QSet<QString> commonMetaCommands();
     void processCommonMetaCommand(const Location& location,
-                                  const QString& command, const QString& arg,
+                                  const QString& command,
+                                  const ArgLocPair& arg,
                                   Node *node, Tree *tree);
     static void extractPageLinkAndDesc(const QString& arg,
                                        QString* link,
index 4e010fc..6f11773 100644 (file)
@@ -537,16 +537,16 @@ QSet<QString> CppCodeParser::topicCommands()
  */
 Node* CppCodeParser::processTopicCommand(const Doc& doc,
                                          const QString& command,
-                                         const QString& arg)
+                                         const ArgLocPair& arg)
 {
     if (command == COMMAND_FN) {
         QStringList parentPath;
         FunctionNode *func = 0;
         FunctionNode *clone = 0;
 
-        if (!makeFunctionNode(arg, &parentPath, &clone) &&
-                !makeFunctionNode("void " + arg, &parentPath, &clone)) {
-            doc.location().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN));
+        if (!makeFunctionNode(arg.first, &parentPath, &clone) &&
+                !makeFunctionNode("void " + arg.first, &parentPath, &clone)) {
+            arg.second.warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN));
         }
         else {
             if (!activeNamespaces_.isEmpty()) {
@@ -595,10 +595,9 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
         QStringList parentPath;
         FunctionNode *func = 0;
 
-        if (makeFunctionNode(arg, &parentPath, &func, tree_->root())) {
+        if (makeFunctionNode(arg.first, &parentPath, &func, tree_->root())) {
             if (!parentPath.isEmpty()) {
-                doc.location().warning(tr("Invalid syntax in '\\%1'")
-                                       .arg(COMMAND_MACRO));
+                arg.second.warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
                 delete func;
                 func = 0;
             }
@@ -615,15 +614,14 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
             }
             return func;
         }
-        else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg)) {
-            func = new FunctionNode(tree_->root(), arg);
+        else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg.first)) {
+            func = new FunctionNode(tree_->root(), arg.first);
             func->setAccess(Node::Public);
             func->setLocation(doc.location());
             func->setMetaness(FunctionNode::MacroWithoutParams);
         }
         else {
-            doc.location().warning(tr("Invalid syntax in '\\%1'")
-                                   .arg(COMMAND_MACRO));
+            doc.location().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
 
         }
         return func;
@@ -642,7 +640,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
         if (type == Node::Fake)
             subtype = Node::QmlClass;
 
-        QStringList paths = arg.split(QLatin1Char(' '));
+        QStringList paths = arg.first.split(QLatin1Char(' '));
         QStringList path = paths[0].split("::");
         Node *node = 0;
 
@@ -672,7 +670,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
 
         if (node == 0) {
             doc.location().warning(tr("Cannot find '%1' specified with '\\%2' in any header file")
-                                   .arg(arg).arg(command));
+                                   .arg(arg.first).arg(command));
             lastPath = path;
 
         }
@@ -690,32 +688,32 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
     }
     else if (command == COMMAND_EXAMPLE) {
         if (Config::generateExamples) {
-            ExampleNode* en = new ExampleNode(tree_->root(), arg);
+            ExampleNode* en = new ExampleNode(tree_->root(), arg.first);
             createExampleFileNodes(en);
             return en;
         }
     }
     else if (command == COMMAND_EXTERNALPAGE) {
-        return new FakeNode(tree_->root(), arg, Node::ExternalPage, Node::ArticlePage);
+        return new FakeNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
     }
     else if (command == COMMAND_FILE) {
-        return new FakeNode(tree_->root(), arg, Node::File, Node::NoPageType);
+        return new FakeNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
     }
     else if (command == COMMAND_GROUP) {
-        return new FakeNode(tree_->root(), arg, Node::Group, Node::OverviewPage);
+        return new FakeNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
     }
     else if (command == COMMAND_HEADERFILE) {
-        return new FakeNode(tree_->root(), arg, Node::HeaderFile, Node::ApiPage);
+        return new FakeNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
     }
     else if (command == COMMAND_MODULE) {
-        return new FakeNode(tree_->root(), arg, Node::Module, Node::OverviewPage);
+        return new FakeNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
     }
     else if (command == COMMAND_QMLMODULE) {
         return FakeNode::lookupQmlModuleNode(tree_, arg);
     }
     else if (command == COMMAND_PAGE) {
         Node::PageType ptype = Node::ArticlePage;
-        QStringList args = arg.split(QLatin1Char(' '));
+        QStringList args = arg.first.split(QLatin1Char(' '));
         if (args.size() > 1) {
             QString t = args[1].toLower();
             if (t == "howto")
@@ -757,12 +755,12 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
         return fn;
     }
     else if (command == COMMAND_DITAMAP) {
-        FakeNode* fn = new DitaMapNode(tree_->root(), arg);
+        FakeNode* fn = new DitaMapNode(tree_->root(), arg.first);
         return fn;
     }
     else if (command == COMMAND_QMLCLASS) {
         ClassNode* classNode = 0;
-        QStringList names = arg.split(QLatin1Char(' '));
+        QStringList names = arg.first.split(QLatin1Char(' '));
         if (names.size() > 1)
             classNode = tree_->findClassNode(names[1].split("::"));
 
@@ -779,12 +777,13 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
          */
         NameCollisionNode* ncn = tree_->checkForCollision(names[0]);
         QmlClassNode* qcn = new QmlClassNode(tree_->root(), names[0], classNode);
+        qcn->setLocation(location());
         if (ncn)
             ncn->addCollision(qcn);
         return qcn;
     }
     else if (command == COMMAND_QMLBASICTYPE) {
-        return new QmlBasicTypeNode(tree_->root(), arg);
+        return new QmlBasicTypeNode(tree_->root(), arg.first);
     }
     else if ((command == COMMAND_QMLSIGNAL) ||
              (command == COMMAND_QMLMETHOD) ||
@@ -793,18 +792,39 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
         QString module;
         QString element;
         QString type;
-        if (splitQmlMethodArg(doc,arg,type,module,element)) {
+        if (splitQmlMethodArg(doc,arg.first,type,module,element)) {
             QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
             if (qmlClass) {
                 if (command == COMMAND_QMLSIGNAL)
-                    return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,false,COMMAND_QMLSIGNAL);
+                    return makeFunctionNode(doc,
+                                            arg.first,
+                                            qmlClass,
+                                            Node::QmlSignal,
+                                            false,
+                                            COMMAND_QMLSIGNAL);
                 else if (command == COMMAND_QMLATTACHEDSIGNAL)
-                    return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,true,COMMAND_QMLATTACHEDSIGNAL);
+                    return makeFunctionNode(doc,
+                                            arg.first,
+                                            qmlClass,
+                                            Node::QmlSignal,
+                                            true,
+                                            COMMAND_QMLATTACHEDSIGNAL);
                 else if (command == COMMAND_QMLMETHOD) {
-                    return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,false,COMMAND_QMLMETHOD);
+                    return makeFunctionNode(doc,
+                                            arg.first,
+                                            qmlClass,
+                                            Node::QmlMethod,
+                                            false,
+                                            COMMAND_QMLMETHOD);
                 }
                 else if (command == COMMAND_QMLATTACHEDMETHOD)
-                    return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,true,COMMAND_QMLATTACHEDMETHOD);
+                    return makeFunctionNode(doc,
+                                            arg.
+                                            first,
+                                            qmlClass,
+                                            Node::QmlMethod,
+                                            true,
+                                            COMMAND_QMLATTACHEDMETHOD);
                 else
                     return 0; // never get here.
             }
@@ -925,18 +945,20 @@ bool CppCodeParser::splitQmlMethodArg(const Doc& doc,
  */
 Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
                                               const QString& command,
-                                              const QStringList& args)
+                                              const ArgList& args)
 {
     QmlPropGroupNode* qmlPropGroup = 0;
     if ((command == COMMAND_QMLPROPERTY) ||
             (command == COMMAND_QMLATTACHEDPROPERTY)) {
+        QString arg;
         QString type;
         QString module;
         QString element;
         QString property;
         bool attached = (command == COMMAND_QMLATTACHEDPROPERTY);
-        QStringList::ConstIterator arg = args.begin();
-        if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) {
+        ArgList::ConstIterator argsIter = args.begin();
+        arg = argsIter->first;
+        if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
             QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
             if (qmlClass) {
                 qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached);
@@ -954,9 +976,10 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
                 bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*');
                 qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable()));
             }
-            ++arg;
-            while (arg != args.end()) {
-                if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) {
+            ++argsIter;
+            while (argsIter != args.end()) {
+                arg = argsIter->first;
+                if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
                     QmlPropertyNode* qmlPropNode = new QmlPropertyNode(qmlPropGroup,
                                                                        property,
                                                                        type,
@@ -966,7 +989,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
                         qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable()));
                     }
                 }
-                ++arg;
+                ++argsIter;
             }
         }
     }
@@ -1001,9 +1024,10 @@ QSet<QString> CppCodeParser::otherMetaCommands()
  */
 void CppCodeParser::processOtherMetaCommand(const Doc& doc,
                                             const QString& command,
-                                            const QString& arg,
+                                            const ArgLocPair& argLocPair,
                                             Node *node)
 {
+    QString arg = argLocPair.first;
     if (command == COMMAND_INHEADERFILE) {
         if (node != 0 && node->isInnerNode()) {
             ((InnerNode *) node)->addInclude(arg);
@@ -1152,7 +1176,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
         }
     }
     else {
-        processCommonMetaCommand(doc.location(),command,arg,node,tree_);
+        processCommonMetaCommand(doc.location(),command,argLocPair,node,tree_);
     }
 }
 
@@ -1166,8 +1190,8 @@ void CppCodeParser::processOtherMetaCommands(const Doc& doc, Node *node)
     const QSet<QString> metaCommands = doc.metaCommandsUsed();
     QSet<QString>::ConstIterator cmd = metaCommands.begin();
     while (cmd != metaCommands.end()) {
-        QStringList args = doc.metaCommandArgs(*cmd);
-        QStringList::ConstIterator arg = args.begin();
+        ArgList args = doc.metaCommandArgs(*cmd);
+        ArgList::ConstIterator arg = args.begin();
         while (arg != args.end()) {
             processOtherMetaCommand(doc, *cmd, *arg, node);
             ++arg;
@@ -2209,10 +2233,9 @@ bool CppCodeParser::matchDocsAndStuff()
             Doc doc(start_loc,end_loc,comment,metacommandsAllowed);
 
             QString topic;
-            QStringList args;
+            ArgList args;
 
-            QSet<QString> topicCommandsUsed = topicCommandsAllowed &
-                    doc.metaCommandsUsed();
+            QSet<QString> topicCommandsUsed = topicCommandsAllowed & doc.metaCommandsUsed();
 
             /*
               There should be one topic command in the set,
@@ -2273,7 +2296,7 @@ bool CppCodeParser::matchDocsAndStuff()
                     }
                 }
                 else {
-                    QStringList::ConstIterator a = args.begin();
+                    ArgList::ConstIterator a = args.begin();
                     while (a != args.end()) {
                         Doc nodeDoc = doc;
                         Node *node = processTopicCommand(nodeDoc,topic,*a);
index 74abb99..0f4b511 100644 (file)
@@ -88,12 +88,12 @@ protected:
     virtual QSet<QString> topicCommands();
     virtual Node *processTopicCommand(const Doc& doc,
                                       const QString& command,
-                                      const QString& arg);
+                                      const ArgLocPair& arg);
 #ifdef QDOC_QML
     // might need to implement this in QsCodeParser as well.
     virtual Node *processTopicCommandGroup(const Doc& doc,
                                            const QString& command,
-                                           const QStringList& args);
+                                           const ArgList& args);
     bool splitQmlPropertyArg(const Doc& doc,
                              const QString& arg,
                              QString& type,
@@ -109,7 +109,7 @@ protected:
     virtual QSet<QString> otherMetaCommands();
     virtual void processOtherMetaCommand(const Doc& doc,
                                          const QString& command,
-                                         const QString& arg,
+                                         const ArgLocPair& argLocPair,
                                          Node *node);
     void processOtherMetaCommands(const Doc& doc, Node *node);
 
index 0c88cbc..fc02331 100644 (file)
@@ -3295,7 +3295,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /*
             QString group;
             bool isGroupPage = false;
             if (fakeNode->doc().metaCommandsUsed().contains("group")) {
-                group = fakeNode->doc().metaCommandArgs("group")[0];
+                group = fakeNode->doc().metaCommandArgs("group")[0].first;
                 isGroupPage = true;
             }
 
index eb0efc5..af7e26d 100644 (file)
@@ -346,6 +346,8 @@ static QString cleanLink(const QString &link)
     return link.mid(colonPos + 1).simplified();
 }
 
+typedef QMap<QString, ArgList> CommandMap;
+
 class DocPrivate : public Shared
 {
 public:
@@ -368,7 +370,7 @@ public:
     QStringList enumItemList;
     QStringList omitEnumItemList;
     QSet<QString> metacommandsUsed;
-    QCommandMap metaCommandMap;
+    CommandMap metaCommandMap;
     bool hasLegalese : 1;
     bool hasSectioningUnits : 1;
     DocPrivateExtra *extra;
@@ -1386,13 +1388,13 @@ void DocParser::parse(const QString& source,
                         append(Atom::ParaRight);
                         p1 = getMetaCommandArgument(cmdStr);
                     }
-                    priv->metaCommandMap[cmdStr].append(p1);
+                    priv->metaCommandMap[cmdStr].append(ArgLocPair(p1,location()));
                     break;
                 case NOT_A_CMD:
                     if (metaCommandSet.contains(cmdStr)) {
                         priv->metacommandsUsed.insert(cmdStr);
                         QString arg = getMetaCommandArgument(cmdStr);
-                        priv->metaCommandMap[cmdStr].append(arg);
+                        priv->metaCommandMap[cmdStr].append(ArgLocPair(arg,location()));
                         if (possibleTopics.contains(cmdStr)) {
                             priv->topics.append(Topic(cmdStr,arg));
                         }
@@ -3043,9 +3045,9 @@ const TopicList& Doc::topicsUsed() const
     return priv == 0 ? *nullTopicList() : priv->topics;
 }
 
-QStringList Doc::metaCommandArgs(const QString& metacommand) const
+ArgList Doc::metaCommandArgs(const QString& metacommand) const
 {
-    return priv == 0 ? QStringList() : priv->metaCommandMap.value(metacommand);
+    return priv == 0 ? ArgList() : priv->metaCommandMap.value(metacommand);
 }
 
 const QList<Text> &Doc::alsoList() const
index d3fd2db..1f83f95 100644 (file)
@@ -63,7 +63,8 @@ class Text;
 class FakeNode;
 class DitaRef;
 
-typedef QMap<QString, QStringList> QCommandMap;
+typedef QPair<QString, Location> ArgLocPair;
+typedef QList<ArgLocPair> ArgList;
 typedef QMap<QString, QString> QStringMap;
 typedef QMultiMap<QString, QString> QStringMultiMap;
 
@@ -168,7 +169,7 @@ public:
     const QStringList &omitEnumItemNames() const;
     const QSet<QString> &metaCommandsUsed() const;
     const TopicList& topicsUsed() const;
-    QStringList metaCommandArgs( const QString& metaCommand ) const;
+    ArgList metaCommandArgs(const QString& metaCommand) const;
     const QList<Text> &alsoList() const;
     bool hasTableOfContents() const;
     bool hasKeywords() const;
index ef3bf8d..5755b9a 100644 (file)
@@ -2683,7 +2683,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m
             QString group;
             bool isGroupPage = false;
             if (fakeNode->doc().metaCommandsUsed().contains("group")) {
-                group = fakeNode->doc().metaCommandArgs("group")[0];
+                group = fakeNode->doc().metaCommandArgs("group")[0].first;
                 isGroupPage = true;
             }
 
index 30fa76a..bb593ae 100644 (file)
@@ -1478,7 +1478,6 @@ FakeNode::FakeNode(InnerNode* parent, const QString& name, SubType subtype, Node
         setPageType(OverviewPage);
         break;
     case QmlModule:
-        setQmlModule(name);
         setPageType(OverviewPage);
         break;
     case QmlClass:
@@ -1574,10 +1573,10 @@ void FakeNode::insertQmlModuleNode(const QString& qmid, FakeNode* fn)
   and inserted into the QML module map mapped to the QML module
   identifier constructed from \a arg.
  */
-FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const QString& arg)
+FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg)
 {
     QStringList dotSplit;
-    QStringList blankSplit = arg.split(QLatin1Char(' '));
+    QStringList blankSplit = arg.first.split(QLatin1Char(' '));
     QString qmid = blankSplit[0];
     if (blankSplit.size() > 1) {
         dotSplit = blankSplit[1].split(QLatin1Char('.'));
@@ -1587,7 +1586,8 @@ FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const QString& arg)
     if (qmlModuleMap_.contains(qmid))
         fn = qmlModuleMap_.value(qmid);
     if (!fn) {
-        fn = new FakeNode(tree->root(), arg, Node::QmlModule, Node::OverviewPage);
+        fn = new FakeNode(tree->root(), arg.first, Node::QmlModule, Node::OverviewPage);
+        fn->setQmlModule(arg);
         insertQmlModuleNode(qmid,fn);
     }
     return fn;
@@ -2134,10 +2134,10 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs)
   true is returned. If any of the three is not found or is not
   correct, false is returned.
  */
-bool Node::setQmlModule(const QString& arg)
+bool Node::setQmlModule(const ArgLocPair& arg)
 {
     QStringList dotSplit;
-    QStringList blankSplit = arg.split(QLatin1Char(' '));
+    QStringList blankSplit = arg.first.split(QLatin1Char(' '));
     qmlModuleName_ = blankSplit[0];
     qmlModuleVersionMajor_ = "1";
     qmlModuleVersionMinor_ = "0";
@@ -2149,10 +2149,10 @@ bool Node::setQmlModule(const QString& arg)
             return true;
         }
         else
-            doc().location().warning(tr("Minor version number missing for '\\qmlmodule' or '\\inqmlmodule'; 0 assumed."));
+            arg.second.warning(tr("Minor version number missing for '\\qmlmodule' or '\\inqmlmodule'; 0 assumed."));
     }
     else
-        doc().location().warning(tr("Module version number missing for '\\qmlmodule' or '\\inqmlmodule'; 1.0 assumed."));
+        arg.second.warning(tr("Module version number missing for '\\qmlmodule' or '\\inqmlmodule'; 1.0 assumed."));
     return false;
 }
 
index 8083f2c..8218b22 100644 (file)
@@ -233,7 +233,7 @@ public:
     virtual QString qmlModuleName() const { return qmlModuleName_; }
     virtual QString qmlModuleVersion() const { return qmlModuleVersionMajor_ + "." + qmlModuleVersionMinor_; }
     virtual QString qmlModuleIdentifier() const { return qmlModuleName_ + qmlModuleVersionMajor_; }
-    virtual bool setQmlModule(const QString& );
+    virtual bool setQmlModule(const ArgLocPair& );
     virtual ClassNode* classNode() { return 0; }
     virtual void clearCurrentChild() { }
     virtual const ImportList* importList() const { return 0; }
@@ -476,7 +476,7 @@ public:
     virtual bool isQmlPropertyGroup() const { return (nodeSubtype_ == QmlPropertyGroup); }
 
     static void insertQmlModuleNode(const QString& qmid, FakeNode* fn);
-    static FakeNode* lookupQmlModuleNode(Tree* tree, const QString& arg);
+    static FakeNode* lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg);
 
 protected:
     SubType nodeSubtype_;
index 1544227..abbea23 100644 (file)
@@ -254,7 +254,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
     QSet<QString> metacommands = doc.metaCommandsUsed();
     if (metacommands.count() > 0) {
         QString topic;
-        QStringList args;
+        ArgList args;
         QSet<QString>::iterator i = metacommands.begin();
         while (i != metacommands.end()) {
             if (topics.contains(*i)) {
@@ -273,7 +273,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                     QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
                     qpn->setReadOnly(0);
                     if (qpn->dataType() == "alias") {
-                        QStringList part = args[0].split(QLatin1Char(' '));
+                        QStringList part = args[0].first.split(QLatin1Char(' '));
                         qpn->setDataType(part[0]);
                     }
                 }
@@ -319,12 +319,12 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                 QmlClassNode::insertQmlModuleMember(qmid, qcn);
             }
             else if (command == COMMAND_QMLINHERITS) {
-                if (node->name() == args[0])
-                    doc.location().warning(tr("%1 tries to inherit itself").arg(args[0]));
+                if (node->name() == args[0].first)
+                    doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
                 else {
-                    CodeParser::setLink(node, Node::InheritsLink, args[0]);
+                    CodeParser::setLink(node, Node::InheritsLink, args[0].first);
                     if (node->subType() == Node::QmlClass) {
-                        QmlClassNode::addInheritedBy(args[0],node);
+                        QmlClassNode::addInheritedBy(args[0].first,node);
                     }
                 }
             }
@@ -341,10 +341,10 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                 }
             }
             else if ((command == COMMAND_INGROUP) && !args.isEmpty()) {
-                QStringList::ConstIterator arg = args.begin();
-                while (arg != args.end()) {
-                    tree->addToGroup(node, *arg);
-                    ++arg;
+                ArgList::ConstIterator argsIter = args.begin();
+                while (argsIter != args.end()) {
+                    tree->addToGroup(node, argsIter->first);
+                    ++argsIter;
                 }
             }
             else if (command == COMMAND_INTERNAL) {
@@ -362,7 +362,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                 node->setStatus(Node::Preliminary);
             }
             else if (command == COMMAND_SINCE) {
-                QString arg = args.join(" ");
+                QString arg = args[0].first; //.join(" ");
                 node->setSince(arg);
             }
             else {