Commit Graph

22 Commits (378d00fc3a50a11c3dce615ea337ad55989c938e)

Author SHA1 Message Date
Sébastien Villemot b2e9ec205e
No longer use reserved identifiers for include guards
Automatically detected using clang-tidy with bugprone-reserved-identifier
check.

By the way, homogeneize the define identifiers in relation to camel case
convention.
2023-12-01 15:39:01 +01:00
Sébastien Villemot 5e89921ea1
Use emplace() and emplace_back() at several places
Automatically detected using clang-tidy with modernize-use-emplace check.
2023-12-01 14:30:03 +01:00
Sébastien Villemot 7e6abc97c4
Add [[nodiscard]] attribute to various functions
Automatically detected using clang-tidy with modernize-use-nodiscard check.
2023-12-01 14:14:44 +01:00
Sébastien Villemot d463607e90
Reformat C++ source code using clang-format 15 2023-11-30 15:58:32 +01:00
Sébastien Villemot d36eb82b7c
Macro processor: removed unused “basename” variable 2023-01-05 15:49:36 +01:00
Sébastien Villemot f0629555a5
Remove useless constructors (aggregate initialization is enough for those)
By the way, turn those classes into structs since all their members are public.
2022-07-20 14:48:28 +02:00
Sébastien Villemot b390390a98
Remove unnecessary inline specifiers
A function defined entirely inside a class/struct/union definition is
implicitly an inline function.
2022-06-24 15:09:08 +02:00
Sébastien Villemot 2795207802
No longer delete move constructor/assignment operator
We follow the advice given by Josuttis in his book about move semantics.

Deleting those member fuctions can be a bug if we want to allow copy semantics,
because overload resolution will no longer fallback to the copy
constructor/assignment operator when given an rvalue.

In particular, this explain why it was not possible to delete the move
assignment operator of the StaticModel class.
2022-05-18 16:33:48 +02:00
Sébastien Villemot 1de3476546
Macroprocessor: fix line counter inside @{} constructs
There were two bugs:
– with the LF convention, newlines were counted twice
– with the CR+LF convention, they were counted four times (because the CR was
  included in yyleng, alongside the LF)

The fix consists in implementing a location_increment() method similar to the
one used for the Dynare parser. This is the most robust solution.

By the way, mark the method DynareFlex::location_increment() method static.
2021-11-19 14:55:14 +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 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
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 f2271eb806
Partial reversion of global indentation of macro processor header files introduced in e2d5a83592
The global indentation introduced in e2d5a83592 made the macro processor header files difficult to read. Revert spacing changes that made simple, inline, one-line functions take up 5 lines making headers tougher to read. Similary change for constructors, not to place each brace on an individual line.
2019-12-23 19:39:34 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Houtan Bastani 2ce6e411b4
remove unused headers 2019-10-04 10:57:36 +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 310f3936fe
macro processor: fix bug: interpret @#includepath at node level instead of at the Driver level 2019-10-02 17:39:05 +02:00
Sébastien Villemot 8c1e48a09e
Add a few more calls to std::move() 2019-08-14 17:27:31 +02:00
Houtan Bastani 06b835c2e0 aesthetic changes 2019-06-27 14:27:59 +02:00
Houtan Bastani 63b2117587 macro processor: remove unnecessary includes 2019-06-27 13:57:19 +02:00
Houtan Bastani 17e040f3f6
macro processor 2.0 2019-06-21 16:45:17 +02:00