-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from galacticusorg/featDirectiveCheck
Add functionality to check that all code directives were processed
- Loading branch information
Showing
10 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Contains a Perl module which implements allocation of variables with some extra, useful functionality. | ||
|
||
package Galacticus::Build::SourceTree::Process::NonProcessed; | ||
use strict; | ||
use warnings; | ||
use Cwd; | ||
use lib $ENV{'GALACTICUS_EXEC_PATH'}."/perl"; | ||
|
||
# Insert hooks for our functions. | ||
$Galacticus::Build::SourceTree::Hooks::processHooks {'nonProcessed'} = \&Process_NonProcessed; | ||
$Galacticus::Build::SourceTree::Hooks::processDependencies{'nonProcessed'} = [ "generics" ]; | ||
|
||
sub Process_NonProcessed { | ||
# Get the tree. | ||
my $tree = shift(); | ||
# Non-processed directives that we simply mark as processed to avoid warnings. | ||
my @nonProcessedDirectives = ( "methods", "workaround", "include", "functionGlobal", "component", "radiusSolverPlausibility", "interTreePositionInsert", "expiry", "scoping", "functionClassType" ); | ||
# Walk the tree, looking for our directive. | ||
my $node = $tree; | ||
my $depth = 0; | ||
while ( $node ) { | ||
if ( | ||
$node->{'type'} =~ m/Task$/ | ||
|| | ||
grep {$node->{'type'} eq $_} @nonProcessedDirectives | ||
) { | ||
# Record that node is processed. | ||
$node->{'directive'}->{'processed'} = 1; | ||
} | ||
$node = &Galacticus::Build::SourceTree::Walk_Tree($node,\$depth); | ||
} | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters