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
122
Issues
122
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
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
cfee93b0
Commit
cfee93b0
authored
Jul 09, 2018
by
Houtan Bastani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preprocessor: submodule update: macro functions
parent
ec3e32a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
+23
-12
doc/dynare.texi
doc/dynare.texi
+22
-11
preprocessor
preprocessor
+1
-1
No files found.
doc/dynare.texi
View file @
cfee93b0
...
...
@@ -10587,8 +10587,8 @@ strings.
It is possible to construct macro-expressions which can be assigned to
macro-variables or used within a macro-directive. The expressions are
constructed using literals of
the four basic types (integers, strings,
arrays of strings, arrays of integers), macro-variables names
and
constructed using literals of
five basic types (integers, strings, arrays of
strings, arrays of integers, and string functions), macro-variable names,
and
standard operators.
String literals have to be enclosed between @strong{double} quotes
...
...
@@ -10651,6 +10651,14 @@ getting the length of an array: @code{length} operator (for example:
@code{[1,2,3]})
@end itemize
The following operators can be used on string functions:
@itemize
@item
comparison operators: @code{==}, @code{!=}
@item
concatenation of two strings: @code{+}
@end itemize
Macro-expressions can be used at two places:
@itemize
@item
...
...
@@ -10706,7 +10714,7 @@ file will be searched for in the folders provided by @ref{-I} and
@end deffn
@deffn {Macro directive} @@#define @var{MACRO_VARIABLE} = @var{MACRO_EXPRESSION}
Defines a macro-variable
.
Defines a macro-variable
or macro-function
@customhead{Example 1}
@example
...
...
@@ -10716,6 +10724,8 @@ Defines a macro-variable.
@@#define w = [ "US", "EA" ] // String array
@@#define z = 3 + v[2] // Equals 5
@@#define t = ("US" in w) // Equals 1 (true)
@@#define f(x) = " + @@@{x@} + @@@{y@}" // Defines a function 'f' with argument 'x'
// that returns the string: ' + @@@{x@} + US'
@end example
@customhead{Example 2}
...
...
@@ -10723,15 +10733,16 @@ Defines a macro-variable.
@example
@@#define x = [ "B", "C" ]
@@#define i = 2
@@#define f(x) = " + @@@{x@}"
model;
A = @@@{x[i]@};
A = @@@{x[i]
+ f("D")
@};
end;
@end example
is strictly equivalent to:
@example
model;
A = C;
A = C
+ D
;
end;
@end example
...
...
preprocessor
@
24455239
Compare
e376267a
...
24455239
Subproject commit
e376267a2867aff79989503f77a2fd2204ed9c8b
Subproject commit
244552393baec541e0d02a2c378a21a6c9409989
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