Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
51d2f715
Verified
Commit
51d2f715
authored
Aug 27, 2019
by
Houtan Bastani
Browse files
submodule update: preprocessor + doc
parent
0e8bb324
Changes
2
Hide whitespace changes
Inline
Side-by-side
doc/manual/source/the-model-file.rst
View file @
51d2f715
...
...
@@ -10716,7 +10716,9 @@ Macro directives
..
macrodir
::
@#
for
MACRO_VARIABLE
in
MACRO_EXPRESSION
@#
for
MACRO_VARIABLE
in
MACRO_EXPRESSION
when
MACRO_EXPRESSION
@#
for
MACRO_TUPLE
in
MACRO_EXPRESSION
@#
for
MACRO_TUPLE
in
MACRO_EXPRESSION
when
MACRO_EXPRESSION
@#
endfor
|
br
|
Loop
construction
for
replicating
portions
of
the
``.
mod
``
...
...
@@ -10745,7 +10747,7 @@ Macro directives
::
model
;
@#
for
(
i
,
j
)
in
[
(
"GDP"
,
"home"
),
(
"GDP"
,
"foreign"
)
]
@#
for
(
i
,
j
)
in
[
"GDP"
]
*
[
"home"
,
"foreign"
]
@{
i
}
_
@{
j
}
=
A
*
K_
@{
j
}^
a
*
L_
@{
j
}^(
1
-
a
);
@#
endfor
end
;
...
...
@@ -10757,6 +10759,27 @@ Macro directives
GDP_foreign
=
A
*
K_foreign
^
a
*
L_foreign
^(
1
-
a
);
end
;
*
Example
*
::
@#
define
countries
=
[
"US"
,
"FR"
,
"JA"
]
@#
define
nth_co
=
"US"
model
;
@#
for
co
in
countries
when
co
!= nth_co
(
1
+
i_
@{
co
})
=
(
1
+
i_
@{
nth_co
})
*
E_
@{
co
}(+
1
)
/
E_
@{
co
};
@#
endfor
E_
@{
nth_co
}
=
1
;
end
;
The
latter
is
equivalent
to
::
model
;
(
1
+
i_FR
)
=
(
1
+
i_US
)
*
E_FR
(+
1
)
/
E_FR
;
(
1
+
i_JA
)
=
(
1
+
i_US
)
*
E_JA
(+
1
)
/
E_JA
;
E_US
=
1
;
end
;
..
macrodir
::
@#
echo
MACRO_EXPRESSION
...
...
@@ -10770,12 +10793,31 @@ Macro directives
output
and
to
abort
.
The
argument
must
evaluate
to
a
string
.
..
macrodir
::
@#
echomacrovars
@#
echomacrovars
(
save
)
@#
echomacrovars
MACRO_VARIABLE_LIST
@#
echomacrovars
(
save
)
MACRO_VARIABLE_LIST
|
br
|
Asks
the
preprocessor
to
display
the
value
of
all
macro
variables
up
until
this
point
.
If
the
``
save
``
option
is
passed
,
then
values
of
the
macro
variables
are
saved
to
``
options_
.
macrovars_line_
<<
line_numbers
>>``.
If
``
NAME_LIST
``
is
passed
,
only
display
/
save
variables
and
functions
with
that
name
.
*
Example
*
::
@#
define
A
=
1
@#
define
B
=
2
@#
define
C
(
x
)
=
x
*
2
@#
echomacrovars
A
C
D
The
output
of
the
command
above
is
::
Macro
Variables
:
A
=
1
Macro
Functions
:
C
(
x
)
=
(
x
*
2
)
|
br
|
Asks
the
preprocessor
to
display
the
value
of
all
macro
variables
up
until
this
point
.
If
the
``
save
``
option
is
passed
,
then
values
of
the
macro
variables
are
saved
to
``
options_
.
macrovars_line_
<<
line_numbers
>>``.
Typical
usages
--------------
...
...
preprocessor
@
0df8dd3b
Compare
db6d4fb0
...
0df8dd3b
Subproject commit
db6d4fb0cd3d59e092f741c0098fbada4d5413d8
Subproject commit
0df8dd3bc262d45bbccfca2f09462c741de67f25
Write
Preview
Supports
Markdown
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