Skip to content

Commit 4df44f0

Browse files
authored
Merge pull request #29 from somiaj/loadmacros-deprecate-save
Save the list of deprecated macros in the PGloadfiles object.
2 parents 71cbbb8 + bc250ed commit 4df44f0

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

lib/PGloadfiles.pm

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ sub new {
6969
my $envir = shift; #pointer to environment hash
7070
warn "PGloadmacros must be called with an environment" unless ref($envir) eq 'HASH';
7171
my $self = {
72-
envir => $envir,
73-
macroFileList => {}, # records macros used in compilation
74-
macrosPath => '',
75-
pwd => '', # current directory -- defined in initialize
72+
envir => $envir,
73+
macroFileList => {}, # records macros used in compilation
74+
macrosPath => '',
75+
pwd => '', # current directory -- defined in initialize
76+
deprecated_macros => [],
7677
};
7778
bless $self, $class;
7879
$self->initialize;
@@ -145,11 +146,8 @@ sub loadMacros {
145146
unless ($macro_file_loaded) {
146147
warn "loadMacros: loading macro file $fileName" if $debugON;
147148
my $filePath = $self->findMacroFile($fileName);
148-
my @dirs = split(/\//, $filePath);
149-
warn "This problem uses the deprecated macro $filePath. It will continue to work but this macro "
150-
. 'will be removed in a future version. This problem should be updated to remove this macro '
151-
. 'to work.'
152-
if $dirs[ $#dirs - 1 ] eq 'deprecated' && $self->{envir}{isInstructor};
149+
my @dirs = split('/', $filePath);
150+
push(@{ $self->{deprecated_macros} }, $dirs[$#dirs]) if $dirs[ $#dirs - 1 ] eq 'deprecated';
153151

154152
#### (check for renamed files here?) ####
155153
warn "loadMacros: look for $fileName at |$filePath|" if $debugON;

0 commit comments

Comments
 (0)