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