qdoc: Report error in square bracket parameter
This update makes qdoc report an error, when it can't recognize a parameter in square brackets. Change-Id: I45d31ec875ac533736ee4a565ff3f217353068dd Task-number: QTBUG-39221 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>bb10
parent
af7f944dc5
commit
f752a7ab6c
|
|
@ -146,6 +146,8 @@ QT_BEGIN_NAMESPACE
|
|||
\value UnknownCommand
|
||||
*/
|
||||
|
||||
QString Atom::noError_ = QString();
|
||||
|
||||
static const struct {
|
||||
const char *english;
|
||||
int no;
|
||||
|
|
@ -399,6 +401,7 @@ LinkAtom::LinkAtom(const QString& p1, const QString& p2)
|
|||
genus_ = Node::CPP;
|
||||
continue;
|
||||
}
|
||||
error_ = p2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -410,7 +413,8 @@ LinkAtom::LinkAtom(const LinkAtom& t)
|
|||
: Atom(Link, t.string()),
|
||||
genus_(t.genus_),
|
||||
goal_(t.goal_),
|
||||
domain_(t.domain_)
|
||||
domain_(t.domain_),
|
||||
error_(t.error_)
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
|
@ -424,7 +428,8 @@ LinkAtom::LinkAtom(Atom* previous, const LinkAtom& t)
|
|||
: Atom(previous, Link, t.string()),
|
||||
genus_(t.genus_),
|
||||
goal_(t.goal_),
|
||||
domain_(t.domain_)
|
||||
domain_(t.domain_),
|
||||
error_(t.error_)
|
||||
{
|
||||
previous->next_ = this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,8 +203,10 @@ public:
|
|||
virtual bool specifiesDomain() const { return false; }
|
||||
virtual Tree* domain() const { return 0; }
|
||||
virtual Node::Type goal() const { return Node::NoType; }
|
||||
virtual const QString& error() { return noError_; }
|
||||
|
||||
protected:
|
||||
static QString noError_;
|
||||
Atom* next_;
|
||||
Type type_;
|
||||
QStringList strs;
|
||||
|
|
@ -223,11 +225,13 @@ class LinkAtom : public Atom
|
|||
virtual bool specifiesDomain() const { return (domain_ != 0); }
|
||||
virtual Tree* domain() const { return domain_; }
|
||||
virtual Node::Type goal() const { return goal_; }
|
||||
virtual const QString& error() { return error_; }
|
||||
|
||||
protected:
|
||||
Node::Genus genus_;
|
||||
Node::Type goal_;
|
||||
Tree* domain_;
|
||||
QString error_;
|
||||
};
|
||||
|
||||
#define ATOM_FORMATTING_BOLD "bold"
|
||||
|
|
|
|||
|
|
@ -975,6 +975,11 @@ void DocParser::parse(const QString& source,
|
|||
if (isLeftBraceAhead()) {
|
||||
p1 = getArgument();
|
||||
append(p1, p2);
|
||||
if (!p2.isEmpty() && !(priv->text.lastAtom()->error().isEmpty())) {
|
||||
location().warning(tr("Check parameter in '[ ]' of '\\l' command: '%1', "
|
||||
"possible misspelling, or unrecognized module name")
|
||||
.arg(priv->text.lastAtom()->error()));
|
||||
}
|
||||
if (isLeftBraceAhead()) {
|
||||
currentLinkAtom = priv->text.lastAtom();
|
||||
startFormat(ATOM_FORMATTING_LINK, cmd);
|
||||
|
|
@ -988,6 +993,11 @@ void DocParser::parse(const QString& source,
|
|||
else {
|
||||
p1 = getArgument();
|
||||
append(p1, p2);
|
||||
if (!p2.isEmpty() && !(priv->text.lastAtom()->error().isEmpty())) {
|
||||
location().warning(tr("Check parameter in '[ ]' of '\\l' command: '%1', "
|
||||
"possible misspelling, or unrecognized module name")
|
||||
.arg(priv->text.lastAtom()->error()));
|
||||
}
|
||||
append(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
|
||||
append(Atom::String, cleanLink(p1));
|
||||
append(Atom::FormattingRight, ATOM_FORMATTING_LINK);
|
||||
|
|
|
|||
Loading…
Reference in New Issue