File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ public virtual bool VisitTranslationUnit(TranslationUnit unit)
311311 if ( ! VisitDeclaration ( unit ) )
312312 return false ;
313313
314- return VisitDeclarationContext ( unit ) ;
314+ return VisitNamespace ( unit ) ;
315315 }
316316
317317 public virtual bool VisitClassDecl ( Class @class )
Original file line number Diff line number Diff line change 33
44namespace CppSharp . Passes
55{
6- class SortDeclarationsPass : TranslationUnitPass
6+ public class SortDeclarationsPass : TranslationUnitPass
77 {
8- private static void SortDeclarations ( Namespace @namespace )
8+ public override bool VisitNamespace ( Namespace @namespace )
99 {
10- @namespace . Declarations = @namespace . Declarations . OrderBy (
11- declaration => declaration . DefinitionOrder ) . ToList ( ) ;
12-
13- foreach ( var childNamespace in @namespace . Namespaces )
14- SortDeclarations ( childNamespace ) ;
15- }
10+ if ( ! base . VisitNamespace ( @namespace ) || @namespace . Ignore )
11+ return false ;
1612
17- public override bool VisitTranslationUnit ( TranslationUnit unit )
18- {
19- SortDeclarations ( unit ) ;
13+ @namespace . Declarations = @namespace . Declarations . OrderBy (
14+ d => d . DefinitionOrder ) . ToList ( ) ;
2015 return true ;
2116 }
2217 }
You can’t perform that action at this time.
0 commit comments