aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-09 10:45:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:04 -0300
commit96316113bcd6e60bc602def066cb03ec5ece436b (patch)
treed446ccb07f2f46c1e8344485a525c49b2293e357 /typesystem.cpp
parent2cf5be8e2354e81298ab0df8c328949845143604 (diff)
Implemented support to "rename to" in argument modification
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index 6049ea060..3e8b2dc49 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -1120,15 +1120,16 @@ bool Handler::startElement(const QString &, const QString &n,
case StackElement::Rename:
case StackElement::Access: {
if (topElement.type != StackElement::ModifyField
- && topElement.type != StackElement::ModifyFunction) {
- m_error = "Function or field modification parent required";
+ && topElement.type != StackElement::ModifyFunction
+ && topElement.type != StackElement::ModifyArgument) {
+ m_error = "Function, field or argument modification parent required";
return false;
}
Modification *mod = 0;
if (topElement.type == StackElement::ModifyFunction)
mod = &m_functionMods.last();
- else
+ else if (topElement.type == StackElement::ModifyField)
mod = &m_fieldMods.last();
QString modifier;
@@ -1142,8 +1143,10 @@ bool Handler::startElement(const QString &, const QString &n,
if (topElement.type == StackElement::ModifyFunction)
mod->setRenamedTo(renamed_to);
- else
+ else if (topElement.type == StackElement::ModifyField)
mod->setRenamedTo(renamed_to);
+ else
+ m_functionMods.last().argument_mods.last().renamed_to = renamed_to;
} else
modifier = attributes["modifier"].toLower();
@@ -1169,7 +1172,8 @@ bool Handler::startElement(const QString &, const QString &n,
return false;
}
- mod->modifiers |= modifierNames[modifier];
+ if (mod)
+ mod->modifiers |= modifierNames[modifier];
}
break;
case StackElement::RemoveArgument: