Commit Graph

23 Commits (74ef3457b4805099ee9885b34173a0d0fd6aca61)

Author SHA1 Message Date
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
Sébastien Villemot 5d564eed07
Fix the interpretation of @#elseif clauses within an @#ifdef or @#ifndef 2020-11-02 12:47:33 +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 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 92f18f58f5
macro processor: comment If class 2019-08-21 18:04:09 +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
Sébastien Villemot 75b000a0b5
Macro processor: ensure that all read-accessors return a const reference
Useless copies are thus avoided in some situations.
2019-08-14 17:36:10 +02:00
Sébastien Villemot c4f331c74c
Macro processor: make more node classes immutable
Since the node classes are stored and copied as std::shared_ptr, a given class
instance can actually be shared by two different expressions. Hence, in order
to prevent weird bugs, it’s necessary to make these classes immutable.

This commit deals with the easy cases.

The remaining (and more complex) ones are:
— Variable
— Array
— Include
— IncludePath
2019-08-14 17:14:42 +02:00
Sébastien Villemot 46a7cf5db7
Macro processor: fix the use of move semantics in constructor
In particular, remove the const keyword before arguments passed-by-value,
because otherwise they can't be moved (since they are immutable).

Also add a few missing calls to std::move(), and remove some calls to
std::move() when they are useless (on class enums, which are fundamental
types.)
2019-08-14 16:43:45 +02:00
Houtan Bastani 2c6a290fb3
remove unnecessary declaration 2019-08-13 13:17:08 -04:00
Houtan Bastani 63b2117587 macro processor: remove unnecessary includes 2019-06-27 13:57:19 +02: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