aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-02-08 13:25:59 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-02-09 18:59:24 -0200
commitebf9aed32e291bb832fa59fa8dd6f17fe004e4e2 (patch)
tree86224bc76b352634f60ff9aeb27e376fd3587b78 /typesystem.cpp
parent8d037108eb0216e178855bb2ba22a09154454ea9 (diff)
Reactivated 'reference-count' tag.
The type system tag '<reference-count action="Add|Remove|..."/>' used on argument modification was uncommented, documentation was written and a unit test was created for it. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index 89dfd4768..69bc8455a 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -97,10 +97,8 @@ public:
DefineOwnership = 0x10000000,
RemoveDefaultExpression = 0x20000000,
NoNullPointers = 0x40000000,
-#if 0
ReferenceCount = 0x80000000,
-#endif
- ParentOwner = 0x80000000,
+ ParentOwner = 0x90000000,
ArgumentModifiers = 0xff000000
};
@@ -160,9 +158,7 @@ public:
tagNames["insert-template"] = StackElement::TemplateInstanceEnum;
tagNames["replace"] = StackElement::Replace;
tagNames["no-null-pointer"] = StackElement::NoNullPointers;
-#if 0
tagNames["reference-count"] = StackElement::ReferenceCount;
-#endif
tagNames["parent"] = StackElement::ParentOwner;
tagNames["inject-documentation"] = StackElement::InjectDocumentation;
tagNames["modify-documentation"] = StackElement::ModifyDocumentation;
@@ -925,11 +921,9 @@ bool Handler::startElement(const QString &, const QString &n,
attributes["from"] = QString();
attributes["to"] = QString();
break;
-#if 0
case StackElement::ReferenceCount:
attributes["action"] = QString();
break;
-#endif
case StackElement::ParentOwner:
attributes["index"] = QString();
attributes["action"] = QString();
@@ -1417,7 +1411,6 @@ bool Handler::startElement(const QString &, const QString &n,
element->value.customFunction = func;
}
break;
-#if 0
case StackElement::ReferenceCount: {
if (topElement.type != StackElement::ModifyArgument) {
m_error = "reference-count must be child of modify-argument";
@@ -1429,9 +1422,9 @@ bool Handler::startElement(const QString &, const QString &n,
static QHash<QString, ReferenceCount::Action> actions;
if (actions.isEmpty()) {
actions["add"] = ReferenceCount::Add;
- actions["add-all"] = ReferenceCount::AddAll;
+ //actions["add-all"] = ReferenceCount::AddAll;
actions["remove"] = ReferenceCount::Remove;
- actions["set"] = ReferenceCount::Set;
+ //actions["set"] = ReferenceCount::Set;
actions["ignore"] = ReferenceCount::Ignore;
}
rc.action = actions.value(attributes["action"].toLower(), ReferenceCount::Invalid);
@@ -1439,13 +1432,12 @@ bool Handler::startElement(const QString &, const QString &n,
if (rc.action == ReferenceCount::Invalid) {
m_error = "unrecognized value for action attribute. supported actions:";
foreach (QString action, actions.keys())
- m_error += " " + action;
+ m_error += " " + action;
}
m_functionMods.last().argument_mods.last().referenceCounts.append(rc);
}
break;
-#endif
case StackElement::ParentOwner: {
if (topElement.type != StackElement::ModifyArgument) {