Browse Source

Use a different method to ignore namespaces in CleanInvalidDeclNamesPass.

If we override the VisitNamespace we would need to duplicate the logic of walking through them and their declarations would not get processed.
pull/1/head
triton 12 years ago
parent
commit
3b3af70cc3
  1. 12
      src/Generator/Passes/CleanInvalidDeclNamesPass.cs

12
src/Generator/Passes/CleanInvalidDeclNamesPass.cs

@ -28,6 +28,11 @@ namespace Cxxi.Passes @@ -28,6 +28,11 @@ namespace Cxxi.Passes
public override bool VisitDeclaration(Declaration decl)
{
// Do not clean up namespace names since it can mess up with the
// names of anonymous or the global namespace.
if (decl is Namespace)
return true;
decl.Name = CheckName(decl.Name);
StringHelpers.CleanupText(ref decl.DebugText);
@ -50,13 +55,6 @@ namespace Cxxi.Passes @@ -50,13 +55,6 @@ namespace Cxxi.Passes
return base.VisitTypedefDecl(typedef);
}
public override bool VisitNamespace(Namespace @namespace)
{
// Do not clean up namespace names since it can mess up with the
// names of anonymous or the global namespace.
return true;
}
private static void CheckEnumName(Enumeration @enum)
{
// If we still do not have a valid name, then try to guess one

Loading…
Cancel
Save