Skip to content

Commit 5227df9

Browse files
somiajpstaabp
authored andcommitted
Save the list of deprecated macros in the PGloadfiles object.
1 parent c28812a commit 5227df9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/PGloadfiles.pm

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ sub new {
7575
my $envir = shift; #pointer to environment hash
7676
warn "PGloadmacros must be called with an environment" unless ref($envir) eq 'HASH';
7777
my $self = {
78-
envir => $envir,
79-
macroFileList => {}, # records macros used in compilation
80-
macrosPath => '',
81-
pwd => '', # current directory -- defined in initialize
78+
envir => $envir,
79+
macroFileList => {}, # records macros used in compilation
80+
macrosPath => '',
81+
pwd => '', # current directory -- defined in initialize
82+
deprecated_macros => [],
8283
};
8384
bless $self, $class;
8485
$self->initialize;
@@ -151,11 +152,8 @@ sub loadMacros {
151152
unless ($macro_file_loaded) {
152153
warn "loadMacros: loading macro file $fileName" if $debugON;
153154
my $filePath = $self->findMacroFile($fileName);
154-
my @dirs = split(/\//, $filePath);
155-
warn "This problem uses the deprecated macro $filePath. It will continue to work but this macro "
156-
. 'will be removed in a future version. This problem should be updated to remove this macro '
157-
. 'to work.'
158-
if $dirs[ $#dirs - 1 ] eq 'deprecated' && $self->{envir}{isInstructor};
155+
my @dirs = split('/', $filePath);
156+
push(@{ $self->{deprecated_macros} }, $dirs[$#dirs]) if $dirs[ $#dirs - 1 ] eq 'deprecated';
159157

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

0 commit comments

Comments
 (0)