Classprefix fixed after private nested classes

some comments and spaces added
This commit is contained in:
Vladimir Kalinin 2013-12-08 01:46:38 +04:00
commit 44323e14b3

View file

@ -3496,7 +3496,8 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
appendChild($$, $7); appendChild($$, $7);
if (am) append_previous_extension($$,am); if (am)
append_previous_extension($$, am);
p = $9; p = $9;
if (p && !nscope_inner) { if (p && !nscope_inner) {
@ -3537,17 +3538,14 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
} }
if (currentOuterClass) if (currentOuterClass)
restore_access_mode($$); restore_access_mode($$);
if (cplus_mode == CPLUS_PRIVATE) {
$$ = 0; /* skip private nested classes */
} else {
Setattr($$, "symtab", Swig_symbol_popscope()); Setattr($$, "symtab", Swig_symbol_popscope());
Classprefix = Getattr($<node>$, "Classprefix"); Classprefix = Getattr($<node>$, "Classprefix");
Delattr($<node>$, "Classprefix"); Delattr($<node>$, "Classprefix");
if (nscope_inner) { if (cplus_mode == CPLUS_PRIVATE) {
$$ = 0; /* skip private nested classes */
} else if (nscope_inner) {
/* this is tricky */ /* this is tricky */
/* we add the declaration in the original namespace */ /* we add the declaration in the original namespace */
if (cplus_mode != CPLUS_PRIVATE)
appendChild(nscope_inner, $$); appendChild(nscope_inner, $$);
Swig_symbol_setscope(Getattr(nscope_inner, "symtab")); Swig_symbol_setscope(Getattr(nscope_inner, "symtab"));
Delete(Namespaceprefix); Delete(Namespaceprefix);
@ -3561,11 +3559,11 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
Namespaceprefix = Swig_symbol_qualifiedscopename(0); Namespaceprefix = Swig_symbol_qualifiedscopename(0);
add_symbols($9); add_symbols($9);
if (nscope) { if (nscope) {
$$ = nscope; $$ = nscope; /* here we return recreated namespace tower instead of the class itself */
if ($9) if ($9)
appendSibling($$, $9); appendSibling($$, $9);
} }
else if (!SwigType_istemplate(ty) && template_parameters == 0) else if (!SwigType_istemplate(ty) && template_parameters == 0) /* for tempalte we need the class itself */
$$ = $9; $$ = $9;
} else { } else {
Delete(yyrename); Delete(yyrename);
@ -3594,7 +3592,7 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
Delattr($$, "class_rename"); Delattr($$, "class_rename");
} }
} }
} Delete(ty);
Swig_symbol_setscope(cscope); Swig_symbol_setscope(cscope);
Delete(Namespaceprefix); Delete(Namespaceprefix);
Namespaceprefix = Swig_symbol_qualifiedscopename(0); Namespaceprefix = Swig_symbol_qualifiedscopename(0);