cherrypick.m: Octave compatibility fix
The plus sign (+) was unescaped in the regular expression, which was confusing Octave. By the way, also remove unneeded parenthesis groupings.time-shift
parent
e4af502360
commit
78fdd50894
|
@ -17,7 +17,7 @@ function json = cherrypick(infile, outfold, eqtags, noresids, json)
|
||||||
% It is expected that the file infile.mod has already been run, and
|
% It is expected that the file infile.mod has already been run, and
|
||||||
% that the associated JSON output is available.
|
% that the associated JSON output is available.
|
||||||
|
|
||||||
% Copyright © 2019-2020 Dynare Team
|
% Copyright © 2019-2021 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -114,7 +114,7 @@ for i=1:length(eqtags)
|
||||||
if any(exogenous_variables_to_be_removed)
|
if any(exogenous_variables_to_be_removed)
|
||||||
switch sum(exogenous_variables_to_be_removed)
|
switch sum(exogenous_variables_to_be_removed)
|
||||||
case 1
|
case 1
|
||||||
RHS = regexprep(RHS, sprintf('(\\ *)(+)(\\ *)%s', xnames{exogenous_variables_to_be_removed}), '');
|
RHS = regexprep(RHS, sprintf('\\ *\\+\\ *%s', xnames{exogenous_variables_to_be_removed}), '');
|
||||||
RHS = regexprep(RHS, sprintf('%s', xnames{exogenous_variables_to_be_removed}), '');
|
RHS = regexprep(RHS, sprintf('%s', xnames{exogenous_variables_to_be_removed}), '');
|
||||||
case 0
|
case 0
|
||||||
% Nothing to do.
|
% Nothing to do.
|
||||||
|
@ -297,4 +297,4 @@ function printlistofvariables(fid, kind, list, DynareModel, vappend)
|
||||||
vlist = sprintf('%s\n\t%s', vlist, list{i});
|
vlist = sprintf('%s\n\t%s', vlist, list{i});
|
||||||
end
|
end
|
||||||
fprintf(fid, '%s;', vlist);
|
fprintf(fid, '%s;', vlist);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue