aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetalang.cpp
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-09 11:11:37 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:04 -0300
commit3649c91f1bdad3ce7db3ff895ae40edf06fc232e (patch)
treed4f41966ff8e1ddc6e267b3c4ff3da75364b12e0 /abstractmetalang.cpp
parent96316113bcd6e60bc602def066cb03ec5ece436b (diff)
Enable warning for arguments without name.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'abstractmetalang.cpp')
-rw-r--r--abstractmetalang.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index 06825652..4a757135 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -699,6 +699,24 @@ bool AbstractMetaFunction::hasModifications(const AbstractMetaClass *implementor
return !modifications(implementor).isEmpty();
}
+QString AbstractMetaFunction::argumentName(int index, bool create, const AbstractMetaClass *implementor) const
+{
+ foreach (FunctionModification mod, modifications(implementor)) {
+ foreach (ArgumentModification argMod, mod.argument_mods) {
+ if ((argMod.index == index) && !argMod.renamed_to.isEmpty())
+ return argMod.renamed_to;
+ }
+ }
+
+ AbstractMetaArgumentList args = arguments();
+ if ((index > 0) && (args.size() > index)) {
+ if (create || args[index]->hasName())
+ return args[index]->argumentName();
+ }
+
+ return QString();
+}
+
bool AbstractMetaFunction::hasInjectedCode() const
{
foreach (const FunctionModification mod, modifications(ownerClass())) {