Correct interface name attributes that are internal
Attributes with 'feature:' prefix are reserved for %feature, not internal usage.
This commit is contained in:
parent
f82efac231
commit
dd6af222f4
3 changed files with 23 additions and 24 deletions
|
|
@ -1581,9 +1581,8 @@ public:
|
||||||
}
|
}
|
||||||
return Language::pragmaDirective(n);
|
return Language::pragmaDirective(n);
|
||||||
}
|
}
|
||||||
String* getQualifiedInterfaceName(Node* n)
|
String* getQualifiedInterfaceName(Node* n) {
|
||||||
{
|
String* ret = Getattr(n, "interface:qname");
|
||||||
String* ret = Getattr(n, "feature:interface:qname");
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
String *nspace = Getattr(n, "sym:nspace");
|
String *nspace = Getattr(n, "sym:nspace");
|
||||||
String *iname = Getattr(n, "feature:interface:name");
|
String *iname = Getattr(n, "feature:interface:name");
|
||||||
|
|
@ -1595,7 +1594,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
ret = Copy(iname);
|
ret = Copy(iname);
|
||||||
}
|
}
|
||||||
Setattr(n, "feature:interface:qname", ret);
|
Setattr(n, "interface:qname", ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -1683,8 +1682,9 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Hash* interface_classes = Getattr(n, "feature:interface:bases"))
|
Hash* interface_bases = Getattr(n, "interface:bases");
|
||||||
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_classes, c_classname);
|
if (interface_bases)
|
||||||
|
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_bases, c_classname);
|
||||||
|
|
||||||
bool derived = baseclass && getProxyName(c_baseclassname);
|
bool derived = baseclass && getProxyName(c_baseclassname);
|
||||||
if (derived && purebase_notderived)
|
if (derived && purebase_notderived)
|
||||||
|
|
@ -2144,7 +2144,7 @@ public:
|
||||||
String *post_code = NewString("");
|
String *post_code = NewString("");
|
||||||
String *terminator_code = NewString("");
|
String *terminator_code = NewString("");
|
||||||
bool is_interface = Getattr(parentNode(n), "feature:interface") != 0
|
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)
|
if (!proxy_flag)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1704,9 +1704,8 @@ public:
|
||||||
return Language::pragmaDirective(n);
|
return Language::pragmaDirective(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
String* getQualifiedInterfaceName(Node* n)
|
String* getQualifiedInterfaceName(Node* n) {
|
||||||
{
|
String* ret = Getattr(n, "interface:qname");
|
||||||
String* ret = Getattr(n, "feature:interface:qname");
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
String *nspace = Getattr(n, "sym:nspace");
|
String *nspace = Getattr(n, "sym:nspace");
|
||||||
String *symname = Getattr(n, "feature:interface:name");
|
String *symname = Getattr(n, "feature:interface:name");
|
||||||
|
|
@ -1721,7 +1720,7 @@ public:
|
||||||
else
|
else
|
||||||
ret = Copy(symname);
|
ret = Copy(symname);
|
||||||
}
|
}
|
||||||
Setattr(n, "feature:interface:qname", ret);
|
Setattr(n, "interface:qname", ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -1815,9 +1814,9 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Hash* interface_classes = Getattr(n, "feature:interface:bases");
|
Hash* interface_bases = Getattr(n, "interface:bases");
|
||||||
if (interface_classes)
|
if (interface_bases)
|
||||||
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_classes, c_classname);
|
addInterfaceNameAndUpcasts(interface_list, interface_upcasts, interface_bases, c_classname);
|
||||||
|
|
||||||
bool derived = baseclass && getProxyName(c_baseclassname);
|
bool derived = baseclass && getProxyName(c_baseclassname);
|
||||||
if (derived && purebase_notderived)
|
if (derived && purebase_notderived)
|
||||||
|
|
@ -2259,7 +2258,7 @@ public:
|
||||||
String *pre_code = NewString("");
|
String *pre_code = NewString("");
|
||||||
String *post_code = NewString("");
|
String *post_code = NewString("");
|
||||||
bool is_interface = Getattr(parentNode(n), "feature:interface") != 0
|
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)
|
if (!proxy_flag)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -3608,7 +3608,7 @@ Hash *Language::getClassHash() const {
|
||||||
//
|
//
|
||||||
// Collect all not abstract methods from the bases marked as "interface"
|
// Collect all not abstract methods from the bases marked as "interface"
|
||||||
static void collect_interface_methods(Node* n, List* methods) {
|
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);
|
List* keys = Keys(bases);
|
||||||
for (Iterator base = First(keys); base.item; base = Next(base)) {
|
for (Iterator base = First(keys); base.item; base = Next(base)) {
|
||||||
Node* cls = Getattr(bases, base.item);
|
Node* cls = Getattr(bases, base.item);
|
||||||
|
|
@ -3616,12 +3616,12 @@ static void collect_interface_methods(Node* n, List* methods) {
|
||||||
continue;
|
continue;
|
||||||
for (Node* child = firstChild(cls); child; child = nextSibling(child)) {
|
for (Node* child = firstChild(cls); child; child = nextSibling(child)) {
|
||||||
if (strcmp(Char(nodeType(child)), "cdecl") == 0) {
|
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
|
continue; // skip methods propagated to bases
|
||||||
Node* m = Copy(child);
|
Node* m = Copy(child);
|
||||||
set_nextSibling(m, NIL);
|
set_nextSibling(m, NIL);
|
||||||
set_previousSibling(m, NIL);
|
set_previousSibling(m, NIL);
|
||||||
Setattr(m, "feature:interface:owner", cls);
|
Setattr(m, "interface:owner", cls);
|
||||||
Append(methods, m);
|
Append(methods, m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3645,12 +3645,12 @@ static void collect_interface_bases(Hash* bases, Node* n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Swig_collect_interface_bases(Node* n) {
|
static void Swig_collect_interface_bases(Node* n) {
|
||||||
Hash* interface_classes = NewHash();
|
Hash* interface_bases = NewHash();
|
||||||
collect_interface_bases(interface_classes, n);
|
collect_interface_bases(interface_bases, n);
|
||||||
if (Len(interface_classes) == 0)
|
if (Len(interface_bases) == 0)
|
||||||
Delete(interface_classes);
|
Delete(interface_bases);
|
||||||
else
|
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
|
// 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)) {
|
if (SwigType_isfunction(resolved_decl)) {
|
||||||
String *name = Getattr(mi.item, "name");
|
String *name = Getattr(mi.item, "name");
|
||||||
for (Node* child = firstChild(n); child; child = nextSibling(child)) {
|
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
|
break; // at the end of the list are newly appended methods
|
||||||
if (checkAttribute(child, "name", name)) {
|
if (checkAttribute(child, "name", name)) {
|
||||||
String *decl = SwigType_typedef_resolve_all(Getattr(child, "decl"));
|
String *decl = SwigType_typedef_resolve_all(Getattr(child, "decl"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue