Commit Graph

34 Commits (c3fc5b1dd799641fbbedfb420358e3dc6f5a4b87)

Author SHA1 Message Date
Sébastien Villemot c3fc5b1dd7
Enable -Wunused-parameter
As a consequence, add many [[maybe_unused]] attributes for legitimate
cases (mainly in virtual functions).
2022-06-24 17:11:48 +02:00
Sébastien Villemot c94dfb848c
C++20 modernization: use initialization within range-based for loop
In particular, use this feature in many loops which feature a special treatment
for the first iteration, using a boolean variable (replacing iterator
manipulation). By the way, also use std::exchange() to simultaneously test the
value of this variable and update it.
2022-06-07 14:35:59 +02:00
Sébastien Villemot ff0e094d6f
Macroprocessor: MinGW bug for filesystem::path→string implicit conversion is still present in Debian 11 2022-01-25 12:57:12 +01:00
Sébastien Villemot 3d894b3a47
Macroprocessor: under Windows, trim trailing slashes and backslashes in the value of “@#includepath”
This is a  workaround for a GCC/MinGW bug present in version 10.2
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88881), that affects
gcc-mingw-w64 in Debian “Bullseye” 11. It is fixed in GCC 10.3, and thus should
be fixed in Debian “Bookworm” 12.

Ref. Madysson/estimation-codes#11
2022-01-25 12:57:09 +01:00
Sébastien Villemot 74ef3457b4
Use secure URL for link to GNU licenses 2021-06-09 17:21:00 +02:00
Sébastien Villemot 1e5de7d71e
Fix typo
Introduced in 4c14dc3fbf.
2021-01-22 14:20:52 +01:00
Sébastien Villemot 4c14dc3fbf
Macro processor: gracefully fail when argument to @#ifdef/@#ifndef is not a variable name
Ref. dynare#1771
2021-01-22 12:20:13 +01:00
Sébastien Villemot ec779235ea
Macro-processor: move environment out of node classes
This completes the separation of parse trees from their evaluation.

Closes: #32
2020-12-07 17:29:05 +01:00
Sébastien Villemot 5d564eed07
Fix the interpretation of @#elseif clauses within an @#ifdef or @#ifndef 2020-11-02 12:47:33 +01:00
Sébastien Villemot df8d8ef116
Fix logic for @#ifndef
Ref. dynare#1747
2020-11-02 12:27:27 +01:00
Houtan Bastani 28b98c7c0e
Rework the function that handles the macro-expansion of the .mod file 2020-02-20 15:30:46 +01:00
Houtan Bastani 1dbbd87d3d
Remove options `noemptylinemacro` and `nolinemacro`; add option `linemacro`
This only concerns the situation when `savemacro` is also passed.

When `linemacro` is passed, the macro expanded .mod file is the same as before

When `linemacro` is not passed, the macro expanded .mod file is equivalent to what it was before when both `noemptylinemacro` and `nolinemacro` were passed.

closes #44
closes #45
2020-02-05 15:19:01 +01:00
Houtan Bastani 12296b620f
macro processor: fix bug in file reported when error encountered after a file has been included
closes #42
2020-02-04 11:12:41 +01:00
Houtan Bastani 6284e991fc
macro processor: remove unnecessary type specifiers 2020-02-04 11:12:41 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Houtan Bastani ef4710cdb1
macro processor: fix for loops 2019-10-29 11:21:09 +01:00
Houtan Bastani 4866bb5902
macro processor: use C++17 structured bindings in for loops 2019-10-29 11:20:21 +01:00
Houtan Bastani 217dadabbd
Use `if` statements with initializers allowed by C++17 2019-10-29 11:20:13 +01:00
Houtan Bastani 361e99bee5
simplify code 2019-10-28 17:25:40 +01:00
Houtan Bastani 7b4616e853
fix cross compilation due to bug in MinGW 8.3.0
implicit conversion from `filesystem::path` to `string` not supported even though it's in the standard
2019-10-04 14:41:48 +02:00
Houtan Bastani 125adff59c
macro processor: insert path instead of string as the path has already been created 2019-10-04 11:10:21 +02:00
Houtan Bastani 031bc62f3a
macro processor: use filesystem after move to C++17, closes #31
ancillary to this change is the move of `paths` out of the Driver class into an argument to parsing/evaluation #32
2019-10-03 14:24:47 +02:00
Houtan Bastani d7e70a4063
macro processor: fix bug: interpret @#include at node level instead of at the Driver level 2019-10-02 17:39:11 +02:00
Houtan Bastani 310f3936fe
macro processor: fix bug: interpret @#includepath at node level instead of at the Driver level 2019-10-02 17:39:05 +02:00
Houtan Bastani 3a21eda40e
macro processor: support @#echomacrovars with symbol_list
closes #26
2019-08-26 18:12:04 +02:00
Houtan Bastani 48466f0e10
macro processor: remove double evaluations of ExpressionPtr 2019-08-21 18:07:40 +02:00
Houtan Bastani b3ec807b90
macro processor: move changes from `cd99bb3af9c8ef6fd881fa0457121894f8edd14e` to the header file 2019-08-19 18:31:18 +02:00
Houtan Bastani cd99bb3af9
macro processor: Make @#include and @#includepath immutable 2019-08-19 18:20:53 +02:00
Houtan Bastani 8ebd2a1735
macro processor: support `@#elseif` directive 2019-08-19 15:14:43 +02:00
Houtan Bastani 309326c372
macro processor: change name of Double type to Real 2019-08-07 10:37:35 -04:00
Houtan Bastani b8205a49df
Revert "macro processor: allow @#includepath to accept a colon-separated list of paths"
This reverts commit 12b09073e3.
2019-06-24 14:39:35 +02:00
Houtan Bastani 12b09073e3
macro processor: allow @#includepath to accept a colon-separated list of paths 2019-06-24 12:20:48 +02:00
Houtan Bastani a3e63101f4
support `save` option of @#echomacrovars 2019-06-24 11:06:31 +02:00
Houtan Bastani 17e040f3f6
macro processor 2.0 2019-06-21 16:45:17 +02:00