Correct interface name attributes that are internal

Attributes with 'feature:' prefix are reserved for %feature, not internal usage.
This commit is contained in:
William S Fulton 2016-02-09 07:22:07 +00:00
commit dd6af222f4
3 changed files with 23 additions and 24 deletions

View file

@ -1581,9 +1581,8 @@ public:
}
return Language::pragmaDirective(n);
}
String* getQualifiedInterfaceName(Node* n)
{
String* ret = Getattr(n, "feature:interface:qname");
String* getQualifiedInterfaceName(Node* n) {
String* ret = Getattr(n, "interface:qname");
if (!ret) {
String *nspace = Getattr(n, "sym:nspace");
String *iname = Getattr(n, "feature:interface:name");
@ -1595,7 +1594,7 @@ public:
} else {
ret = Copy(iname);
}
Setattr(n, "feature:interface:qname", ret);
Setattr(n, "interface:qname", ret);
}
return ret;
}
@ -1683,8 +1682,9 @@ public:
}
}
}
if (Hash* interface_classes = Getattr(n, "feature:interface:bases"))
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_classes, c_classname);
Hash* interface_bases = Getattr(n, "interface:bases");
if (interface_bases)
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_bases, c_classname);
bool derived = baseclass && getProxyName(c_baseclassname);
if (derived && purebase_notderived)
@ -2144,7 +2144,7 @@ public:
String *post_code = NewString("");
String *terminator_code = NewString("");
bool is_interface = Getattr(parentNode(n), "feature:interface") != 0
&& !static_flag && Getattr(n, "feature:interface:owner") == 0;
&& !static_flag && Getattr(n, "interface:owner") == 0;
if (!proxy_flag)
return;

View file

@ -1704,9 +1704,8 @@ public:
return Language::pragmaDirective(n);
}
String* getQualifiedInterfaceName(Node* n)
{
String* ret = Getattr(n, "feature:interface:qname");
String* getQualifiedInterfaceName(Node* n) {
String* ret = Getattr(n, "interface:qname");
if (!ret) {
String *nspace = Getattr(n, "sym:nspace");
String *symname = Getattr(n, "feature:interface:name");
@ -1721,7 +1720,7 @@ public:
else
ret = Copy(symname);
}
Setattr(n, "feature:interface:qname", ret);
Setattr(n, "interface:qname", ret);
}
return ret;
}
@ -1815,9 +1814,9 @@ public:
}
}
Hash* interface_classes = Getattr(n, "feature:interface:bases");
if (interface_classes)
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_classes, c_classname);
Hash* interface_bases = Getattr(n, "interface:bases");
if (interface_bases)
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_bases, c_classname);
bool derived = baseclass && getProxyName(c_baseclassname);
if (derived && purebase_notderived)
@ -2259,7 +2258,7 @@ public:
String *pre_code = NewString("");
String *post_code = NewString("");
bool is_interface = Getattr(parentNode(n), "feature:interface") != 0
&& !static_flag && Getattr(n, "feature:interface:owner") == 0;
&& !static_flag && Getattr(n, "interface:owner") == 0;
if (!proxy_flag)
return;

View file

@ -3608,7 +3608,7 @@ Hash *Language::getClassHash() const {
//
// Collect all not abstract methods from the bases marked as "interface"
static void collect_interface_methods(Node* n, List* methods) {
if (Hash* bases = Getattr(n, "feature:interface:bases")){
if (Hash* bases = Getattr(n, "interface:bases")){
List* keys = Keys(bases);
for (Iterator base = First(keys); base.item; base = Next(base)) {
Node* cls = Getattr(bases, base.item);
@ -3616,12 +3616,12 @@ static void collect_interface_methods(Node* n, List* methods) {
continue;
for (Node* child = firstChild(cls); child; child = nextSibling(child)) {
if (strcmp(Char(nodeType(child)), "cdecl") == 0) {
if (GetFlag(child, "feature:ignore") || Getattr(child, "feature:interface:owner"))
if (GetFlag(child, "feature:ignore") || Getattr(child, "interface:owner"))
continue; // skip methods propagated to bases
Node* m = Copy(child);
set_nextSibling(m, NIL);
set_previousSibling(m, NIL);
Setattr(m, "feature:interface:owner", cls);
Setattr(m, "interface:owner", cls);
Append(methods, m);
}
}
@ -3645,12 +3645,12 @@ static void collect_interface_bases(Hash* bases, Node* n) {
}
static void Swig_collect_interface_bases(Node* n) {
Hash* interface_classes = NewHash();
collect_interface_bases(interface_classes, n);
if (Len(interface_classes) == 0)
Delete(interface_classes);
Hash* interface_bases = NewHash();
collect_interface_bases(interface_bases, n);
if (Len(interface_bases) == 0)
Delete(interface_bases);
else
Setattr(n, "feature:interface:bases", interface_classes);
Setattr(n, "interface:bases", interface_bases);
}
// Append all the interface methods not implemented in the current class, so that it would not be abstract
@ -3669,7 +3669,7 @@ void Swig_propagate_interface_methods(Node *n)
if (SwigType_isfunction(resolved_decl)) {
String *name = Getattr(mi.item, "name");
for (Node* child = firstChild(n); child; child = nextSibling(child)) {
if (Getattr(child, "feature:interface:owner"))
if (Getattr(child, "interface:owner"))
break; // at the end of the list are newly appended methods
if (checkAttribute(child, "name", name)) {
String *decl = SwigType_typedef_resolve_all(Getattr(child, "decl"));