Rangi42
e9e8915725
Refactor to keep lexerState and lexerStateEOL static
...
Also run `clang-format` on everything
2024-03-23 19:14:46 -04:00
Rangi42
507439bc25
Refactor macro args to be owned collectively by their fstack contexts
2024-03-22 14:25:36 -04:00
Rangi42
b85c5cde8f
Use std::shared_ptr for MacroArgs
2024-03-22 14:25:36 -04:00
ISSOtm
52e8e1f9fc
Simplify \@ handling by using std::shared_ptr<std::string>
...
This has been relocated from macro.cpp to fstack.cpp, since both
MACRO and REPT/FOR nodes have their own unique `\@` values.
2024-03-22 14:25:36 -04:00
Sylvie
04405fb444
Use std::shared_ptr for fstack nodes ( #1371 )
2024-03-22 13:27:21 -04:00
Sylvie
f792580816
Only restore parent context's \@ value if it had one defined ( #1366 )
...
This way, if a child context initializes `\@`, the parent won't
reset it. And if the child context did not initialize `\@`,
then resetting it would be redundant.
2024-03-21 19:53:49 -04:00
Sylvie
0300971a17
Fix some header #includes with clangd LSP ( #1370 )
...
Co-authored-by: ISSOtm <eldredhabert0@gmail.com >
2024-03-21 15:13:10 -04:00
Rangi42
e96675be03
Pass std::string references to fstack functions
2024-03-18 14:42:05 -04:00
Rangi42
472d1bde06
Pass std::string references to symbol functions
2024-03-18 14:42:05 -04:00
Rangi42
846a9411b9
Refactor FileStackNode::dump to not need a helper function
2024-03-10 14:14:34 -04:00
Sylvie
820f6b5b3c
Consistently format type qualifiers like const on the right ( #1347 )
2024-03-10 12:21:52 -04:00
Sylvie
53537cf9af
Remove now-unnecessary enum keyword ( #1338 )
...
C++ does not need it
2024-03-08 19:40:41 -05:00
Rangi42
75cc12bb3d
Use std::optional for fstack paths
2024-03-07 21:41:02 -05:00
Rangi42
bd88787cb3
Use FileStackNode constructor to avoid std::monostate possibility
2024-03-05 14:22:29 -05:00
Sylvie
e74073e480
Run clang-format on everything ( #1332 )
2024-03-04 14:22:49 -05:00
Rangi42
277ea9be28
Replace RGBASM non-null pointers with references
2024-03-03 00:57:03 -05:00
Sylvie
a71e4086a2
Use std::string_view for macro bodies ( #1326 )
...
This removes the last use of `strdup`
This required making a lot of related pointers be `const`.
That in turn conflicted with the need to `munmap()` a pointer
eventually, which was similar to the need to eventually `free()`
an `Expansion`'s contents, so I used the same solution of a
`union`. That lets us normally use the `const` pointer for
`const` correctness, and the non-`const` one for the not-really-
mutating destruction cases.
2024-03-02 13:21:28 -05:00
Sylvie
1ac3c0262f
Refactor structs to use methods instead of functions ( #1322 )
2024-03-01 13:11:45 -05:00
Rangi42
e14ba664ea
Remove redundant (void) parameter declarations
2024-03-01 10:41:47 -05:00
Sylvie
043db49676
Replace NULL with nullptr ( #1321 )
2024-02-29 15:06:33 -05:00
Sylvie
eff8c324c8
Remove now-unnecessary struct keyword ( #1320 )
...
C++ acts like structs are `typedef`ed by default
We do have to keep `struct stat`, since there's ambiguity
with the function also called `stat`.
2024-02-29 14:41:58 -05:00
Rangi42
fc5ab8a14c
Clarify comment explaining how referenced works
2024-02-29 13:44:08 -05:00
Rangi42
cf42d035f2
Use std::variant for file stack nodes
2024-02-29 13:44:08 -05:00
Rangi42
0e19f6c0ae
Use automatic allocation for fstack nodes' iters/names
2024-02-29 13:44:08 -05:00
Rangi42
1afc8554c0
Use std::deque for file stack nodes
2024-02-29 13:44:08 -05:00
Sylvie
595c066c2a
Remove #include <stdbool.h> ( #1317 )
2024-02-24 10:51:46 -05:00
Sylvie
c0d534f5ad
No more flexible array members (not standard C++) ( #1307 )
...
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s
* Anonymous types declared in an anonymous union are also non-standard
Only Clang complains about this (-Wnested-anon-types)
2024-02-22 16:22:37 -05:00
Sylvie
6d29d2a67e
Simplify fstk_FindFile usage ( #1310 )
...
* Simplify `fstk_FindFile` usage
* Use `std::string` for `fstk_FindFile`
2024-02-22 13:14:38 +01:00
Rangi
1e70e703a7
Build everything as C++ ( #1176 )
2023-11-07 21:45:56 +01:00