Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dynare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
121
Issues
121
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dynare
dynare
Commits
c258bad2
Commit
c258bad2
authored
Nov 14, 2017
by
Houtan Bastani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynare command line: be less strict in accepting macros from .mod file
parent
c958f4ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
doc/dynare.texi
doc/dynare.texi
+4
-4
matlab/dynare.m
matlab/dynare.m
+10
-11
No files found.
doc/dynare.texi
View file @
c258bad2
...
...
@@ -1006,10 +1006,10 @@ of the @code{.mod} file. They can alternatively be defined in the first line of
the @file{.mod} file, this avoids typing them on the command line each time a
@file{.mod} file is to be run. This line must be a Dynare comment (@emph{ie}
must begin with @code{//}) and the options must be comma separated between
@code{--+ options:} and @code{+--}.
As in the command line, if an option admits
a value the equal symbol must not be surrounded by spaces. For instanc
e
@code{json = compute} is not correct, and should be written
@code{json=compute}.
@code{--+ options:} and @code{+--}.
Note that any text after the @code{+--}
will be discarded. As with the command line, if an option admits a value th
e
equal symbol must not be surrounded by spaces. For instance @code{json =
compute} is not correct, and should be written
@code{json=compute}.
@outputhead
...
...
matlab/dynare.m
View file @
c258bad2
...
...
@@ -196,18 +196,17 @@ end
fid
=
fopen
(
fname
,
'r'
);
firstline
=
fgetl
(
fid
);
fclose
(
fid
);
if
isequal
(
regexp
(
firstline
,
'\s*\/\/'
),
1
)
% First line is commented.
if
regexp
(
firstline
,
'\s*\/\/'
,
'once'
)
==
1
firstline
=
regexprep
(
firstline
,
'\s*\/\/'
,
''
);
if
~
isempty
(
regexp
(
firstline
,
'(^\s
+\-\-\+\s+options:)'
))
% Commented line begins with --+ options:
if
~
isempty
(
regexp
(
firstline
,
'(\s+\+\-\-\s*$)'
))
% Commented line ends with +--
dynoption
=
strsplit
(
firstline
,
{
'--+'
,
'+--'
,
'options:'
,
' '
,
','
}
);
dynoption
(
find
(
cellfun
(
@
(
x
)
isempty
(
x
),
dynoption
)))
=
[]
;
if
isequal
(
nargin
,
1
)
varargin
=
dynoption
;
else
varargin
=
union
(
varargin
,
dynoption
);
end
if
~
isempty
(
regexp
(
firstline
,
'(^\s
*\-\-\+\s*options:\s*)'
,
'once'
))
...
&&
~
isempty
(
regexp
(
firstline
,
'(\s*\+\-\-(\s*\w*\s*)*$)'
,
'once'
))
firstline
=
regexprep
(
firstline
,
'(^\s*\-\-\+\s*options:\s*)'
,
''
);
firstline
=
regexprep
(
firstline
,
'(\s*\+\-\-(\s*\w*\s*)*$)'
,
''
)
;
dynoption
=
strsplit
(
firstline
,
{
' '
,
','
});
if
isequal
(
nargin
,
1
)
varargin
=
dynoption
;
else
varargin
=
union
(
varargin
,
dynoption
);
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment