[pygccxml-commit] SF.net SVN: pygccxml: [167] pygccxml_dev/pygccxml/parser
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-05-27 19:48:33
|
Revision: 167 Author: roman_yakovenko Date: 2006-05-27 12:48:20 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=167&view=rev Log Message: ----------- excluding unnamed classes from being exported Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/class_declaration.py pygccxml_dev/pygccxml/parser/project_reader.py pygccxml_dev/pygccxml/parser/scanner.py pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py =================================================================== --- pygccxml_dev/pygccxml/declarations/class_declaration.py 2006-05-27 18:46:37 UTC (rev 166) +++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2006-05-27 19:48:20 UTC (rev 167) @@ -101,6 +101,8 @@ self._aliases = [] def _get_name_impl( self ): + if not self._name: #class with empty name + return self._name if class_t.USE_DEMANGLED_AS_NAME and self.demangled: fname = algorithm.full_name( self.parent ) if fname.startswith( '::' ) and not self.demangled.startswith( '::' ): Modified: pygccxml_dev/pygccxml/parser/project_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/project_reader.py 2006-05-27 18:46:37 UTC (rev 166) +++ pygccxml_dev/pygccxml/parser/project_reader.py 2006-05-27 19:48:20 UTC (rev 167) @@ -346,6 +346,11 @@ if not decl.name and decl not in joined_decls[decl._name]: decls.append( decl ) joined_decls[decl._name].append( decl ) + elif isinstance( decl, pygccxml.declarations.class_t ): + #unnamed classes + if not decl.name and decl not in joined_decls[decl._name]: + decls.append( decl ) + joined_decls[decl._name].append( decl ) else: assert 1 == len( joined_decls[ decl._name ] ) if isinstance( decl, pygccxml.declarations.namespace_t ): Modified: pygccxml_dev/pygccxml/parser/scanner.py =================================================================== --- pygccxml_dev/pygccxml/parser/scanner.py 2006-05-27 18:46:37 UTC (rev 166) +++ pygccxml_dev/pygccxml/parser/scanner.py 2006-05-27 19:48:20 UTC (rev 167) @@ -366,6 +366,8 @@ def __read_class_impl(self, class_type, attrs): decl = None name = attrs.get(XML_AN_NAME, '') + if '$' in name or '.' in name: + name = '' if attrs.has_key( XML_AN_INCOMPLETE ): decl = self.__decl_factory.create_class_declaration(name=name) else: Modified: pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-05-27 18:46:37 UTC (rev 166) +++ pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py 2006-05-27 19:48:20 UTC (rev 167) @@ -103,6 +103,8 @@ self.wrapper_user_code.append( user_text.user_text_t( code ) ) def _exportable_impl( self ): + if not self.name: + return 'pyplusplus can not expose unnamed classes.' if isinstance( self.parent, declarations.namespace_t ): return '' if not self in self.parent.public_members: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |