Sylvie
820f6b5b3c
Consistently format type qualifiers like const on the right ( #1347 )
2024-03-10 12:21:52 -04:00
Rangi42
569b940b82
No need to manually do the Expression destructor's job
2024-03-09 19:33:53 -05:00
Sylvie
5681be1fd8
Use automatic allocation and std::move for RPN bytes ( #1336 )
2024-03-09 11:12:34 -05: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
097b7c3baf
Use std::string for symbol names
2024-03-07 12:40:33 -05:00
Rangi42
bf45ebb178
Run clang-format to fix some inconsistent style
2024-03-07 11:52:53 -05:00
Rangi42
84bedc7bbe
Use automatic allocation for RPN reasons
2024-03-07 09:58:45 -05:00
Sylvie
292adb27a3
Adapt the RGBASM parser to C++ ( #1333 )
...
This uses variants instead of a `%union`, and "complete symbols"
that can call complex constructors.
2024-03-06 20:40:36 -05:00
Rangi42
053aa80951
Improve some const correctness in RGBASM
2024-03-06 13:53:03 -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
Sylvie
b004648a13
Use std::variant for symbol values ( #1331 )
2024-03-04 08:55:33 -05:00
Rangi42
13904dc536
Remove EQUS callbacks for symbols
...
They're no longer used since `__FILE__` was removed
2024-03-03 21:26:44 -05:00
Sylvie
f8dab23e8f
Use uncommented sizes for pointer-to-array arguments ( #1329 )
...
This is syntactically valid despite not being enforced, and
is a feature we already use elsewhere.
2024-03-03 19:43:08 -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
2e1b0b6421
Remove commented-out C-only macro features
2024-03-02 20:17:22 -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
2069a95e0f
Use std::string for macro args
2024-03-02 05:23:15 -05:00
Rangi42
ba00cf5684
Use std::string for section names
2024-03-02 04:47:02 -05:00
Rangi42
b488d3a90f
Use std::optional<std::string> for lexer expansion names
2024-03-02 04:34:42 -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
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
fc5ab8a14c
Clarify comment explaining how referenced works
2024-02-29 13:44:08 -05:00
Rangi42
d6681d3580
struct Section's src can be const
2024-02-29 13:44:08 -05:00
Rangi42
7daa8759c9
Use std::variant for STRFMT arguments
2024-02-29 13:44:08 -05:00
Rangi42
962398969b
Use std::string for PURGE args
2024-02-29 13:44:08 -05:00
Rangi42
a24df27cd8
Use std::vector for charmap output
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
514044496f
Use std::string for RPN error reasons
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
4b2294292a
Use std::string for target file name
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
17861a970f
Use std::vector for RPN data
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
Rangi42
6a23c5fd48
Use automatic allocation for STRFMT args
2024-02-29 13:44:08 -05:00
Rangi42
a4ed7e1d18
Use automatic allocation for charmaps
2024-02-29 13:44:08 -05:00
Rangi42
1b8e588961
Use automatic allocation for patch RPN
2024-02-29 13:44:08 -05:00
Rangi42
dec1811d20
Use automatic allocation for section data
2024-02-29 13:44:08 -05:00
Rangi42
72e9f55368
Use automatic allocation for patches
2024-02-29 13:44:08 -05:00
Rangi42
9140180c85
Use automatic allocation for sections
2024-02-29 13:44:08 -05:00