Revert recent using-declarations code changes
Reverts code changes from 7b5a615e50
merge commit in preparation for better fix.
Issue #655 and issue #1488.
This commit is contained in:
parent
7b5a615e50
commit
3f36157b39
3 changed files with 3 additions and 40 deletions
|
|
@ -4468,12 +4468,11 @@ templateparameterstail : COMMA templateparameter templateparameterstail {
|
||||||
/* Namespace support */
|
/* Namespace support */
|
||||||
|
|
||||||
cpp_using_decl : USING idcolon SEMI {
|
cpp_using_decl : USING idcolon SEMI {
|
||||||
String *uname = Swig_symbol_type_qualify($2,0);
|
String *uname = Swig_symbol_type_qualify($2,0);
|
||||||
String *name = Swig_scopename_last($2);
|
String *name = Swig_scopename_last($2);
|
||||||
$$ = new_node("using");
|
$$ = new_node("using");
|
||||||
Setattr($$,"uname",uname);
|
Setattr($$,"uname",uname);
|
||||||
Setattr($$,"name", name);
|
Setattr($$,"name", name);
|
||||||
Swig_symbol_add_using(name, uname, $$);
|
|
||||||
Delete(uname);
|
Delete(uname);
|
||||||
Delete(name);
|
Delete(name);
|
||||||
add_symbols($$);
|
add_symbols($$);
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,6 @@ extern "C" {
|
||||||
extern void Swig_symbol_print_tables_summary(void);
|
extern void Swig_symbol_print_tables_summary(void);
|
||||||
extern void Swig_symbol_print_symbols(void);
|
extern void Swig_symbol_print_symbols(void);
|
||||||
extern void Swig_symbol_print_csymbols(void);
|
extern void Swig_symbol_print_csymbols(void);
|
||||||
extern void Swig_symbol_add_using(String *name, String *uname, Node *n);
|
|
||||||
extern void Swig_symbol_init(void);
|
extern void Swig_symbol_init(void);
|
||||||
extern void Swig_symbol_setscopename(const_String_or_char_ptr name);
|
extern void Swig_symbol_setscopename(const_String_or_char_ptr name);
|
||||||
extern String *Swig_symbol_getscopename(void);
|
extern String *Swig_symbol_getscopename(void);
|
||||||
|
|
|
||||||
|
|
@ -382,29 +382,6 @@ String *Swig_symbol_qualified_language_scopename(Symtab *n) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
|
||||||
* Swig_symbol_add_using()
|
|
||||||
*
|
|
||||||
* Adds a node to the C symbol table for a using declaration.
|
|
||||||
* Used for using-declarations within classes/structs.
|
|
||||||
* ----------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void Swig_symbol_add_using(String *name, String *uname, Node *n) {
|
|
||||||
Hash *h;
|
|
||||||
h = Swig_symbol_clookup(uname, 0);
|
|
||||||
if (h && (checkAttribute(h, "kind", "class") || checkAttribute(h, "kind", "struct"))) {
|
|
||||||
String *qcurrent = Swig_symbol_qualifiedscopename(0);
|
|
||||||
if (qcurrent) {
|
|
||||||
Append(qcurrent, "::");
|
|
||||||
Append(qcurrent, name);
|
|
||||||
} else {
|
|
||||||
qcurrent = NewString(name);
|
|
||||||
}
|
|
||||||
Setattr(symtabs, qcurrent, n);
|
|
||||||
Delete(qcurrent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_symbol_newscope()
|
* Swig_symbol_newscope()
|
||||||
*
|
*
|
||||||
|
|
@ -1097,19 +1074,7 @@ static Node *symbol_lookup_qualified(const_String_or_char_ptr name, Symtab *symt
|
||||||
Delete(qalloc);
|
Delete(qalloc);
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
if (checkAttribute(st, "nodeType", "using")) {
|
n = symbol_lookup(name, st, checkfunc);
|
||||||
String *uname = Getattr(st, "uname");
|
|
||||||
if (uname) {
|
|
||||||
st = Getattr(symtabs, uname);
|
|
||||||
if (st) {
|
|
||||||
n = symbol_lookup(name, st, checkfunc);
|
|
||||||
} else {
|
|
||||||
fprintf(stderr, "Error: Found corrupt 'using' node\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Getattr(st, "csymtab")) {
|
|
||||||
n = symbol_lookup(name, st, checkfunc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (qalloc)
|
if (qalloc)
|
||||||
Delete(qalloc);
|
Delete(qalloc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue