Commit Graph

21 Commits

Author SHA1 Message Date
Sylvie
e74073e480 Run clang-format on everything (#1332) 2024-03-04 14:22:49 -05:00
Sylvie
8cf446b14c Use std::variant for lexer mmap/buffer state (#1328) 2024-03-03 18:45:50 -05:00
Rangi42
277ea9be28 Replace RGBASM non-null pointers with references 2024-03-03 00:57:03 -05:00
Rangi42
19bb12754b Use new allocation for expanding \# 2024-03-02 08:04:59 -05:00
Rangi42
dbcb82799e Use std::vector for capture buffer 2024-03-02 06:46:11 -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
Rangi42
b488d3a90f Use std::optional<std::string> for lexer expansion names 2024-03-02 04:34:42 -05:00
Rangi42
e14ba664ea Remove redundant (void) parameter declarations 2024-03-01 10:41:47 -05:00
Rangi42
91d22f180e Reorganize the asm parser to be more like the linker script parser
Split the declarations into those required for the `%union` and
those only required for the `code`.
Only declare functions on top; define them at the bottom.
2024-02-29 16:23:53 -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
d1fa5ccd4d Rename lexer_DeleteState to lexer_CleanupState 2024-02-29 13:44:08 -05:00
Rangi42
af055ecd27 Use automatic allocation for IF stacks and expansions
Switch to using `std::deque` for IF stacks (supports `.clear()`)
2024-02-29 13:44:08 -05:00
Rangi42
31836967fa Use automatic allocation for lexer states
Lexer states are now owned by fstack contexts
2024-02-29 13:44:08 -05:00
Rangi42
843f3394c8 Use automatic allocation for DS args 2024-02-29 13:44:08 -05:00
Rangi42
b1aa98b43d Use automatic allocation for PURGE args 2024-02-29 13:44:08 -05:00
Sylvie
595c066c2a Remove #include <stdbool.h> (#1317) 2024-02-24 10:51:46 -05:00
Sylvie
54d6a22d19 Build with pedantically standard C++ (#1309)
* Remove array designators (not standard C++)

* Build with pedantically standard C++
2024-02-23 16:46:53 -05:00
Rangi
756f2866bb Refactor alignment spec parsing (#1253) 2023-11-25 00:06:05 +01:00
Rangi
46e29de66f Implement ds align[alignment, offset] (#1181) 2023-11-21 23:57:47 +01:00
Rangi
1e70e703a7 Build everything as C++ (#1176) 2023-11-07 21:45:56 +01:00