Rangi42
912a1504ec
Defer closing of depend file
2024-03-27 11:44:26 -04:00
Rangi42
78801e324c
Group pointer and size as a ContentSpan struct
2024-03-27 11:27:34 -04:00
Rangi42
bf0cabb3ea
Use std::shared_ptr for lexer capture buffers
2024-03-27 11:27:34 -04:00
Rangi42
cb59119881
Use automatically-allocated std::string_view for macros
2024-03-25 11:33:17 -04:00
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
9f239f6dcc
Use std::shared_ptr<std::string> for lexed/parsed strings
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
0300971a17
Fix some header #includes with clangd LSP ( #1370 )
...
Co-authored-by: ISSOtm <eldredhabert0@gmail.com >
2024-03-21 15:13:10 -04:00
Sylvie
0af1e512c2
Use std::get_if instead of std::visit ( #1367 )
...
`std::visit` is (arguably) cleaner code, but older versions of gcc
and clang (not very old; the ones packaged with Ubuntu 22.04 LTS)
compile them as tables of function pointers, instead of efficient
jump tables.
2024-03-20 22:37:54 -04:00
Sylvie
554778da5b
Built-in symbols are "<builtin>", not "<command-line>" ( #1362 )
2024-03-19 16:01:45 -04:00
Rangi42
472d1bde06
Pass std::string references to symbol functions
2024-03-18 14:42:05 -04:00
Rangi42
cefc4f4aa3
Use std::unordered_map for symbols
2024-03-16 11:19:19 -04:00
Sylvie
820f6b5b3c
Consistently format type qualifiers like const on the right ( #1347 )
2024-03-10 12:21:52 -04:00
Sylvie
17444e825a
Reduce the header declarations ( #1342 )
...
- Since we have style rules to include foo.hpp at the top of its
corresponding foo.cpp, this takes any headers included by foo.hpp
as being also guaranteed for foo.cpp.
- Use C-style <foo.h> instead of <cfoo>, since the latter only
guarantees putting symbols in the `std` namespace, which we are
not using for C functions (e.g. `printf` not `std::printf`).
- Remove now-unused `__PRETTY_FUNCTION__` reporting
2024-03-09 14:55:39 -05:00
Rangi42
563d699394
Avoid an extra operation if !labelScope (thanks, ISSOtm)
2024-03-07 17:33:33 -05:00
Rangi42
aed172071b
Replace some macros with static functions or constants
2024-03-07 16:10:05 -05:00
Rangi42
097b7c3baf
Use std::string for symbol names
2024-03-07 12:40:33 -05:00
Rangi42
e5b7e65e91
Use std::nothrow from <new> with every new allocation
2024-03-07 09:56:15 -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
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
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
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
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
962398969b
Use std::string for PURGE args
2024-02-29 13:44:08 -05:00
Rangi42
53343d2fa6
Use automatic allocation for symbols
2024-02-29 13:44:08 -05:00
Rangi42
83d3a39dcd
Use std::map for rgbasm symbols
2024-02-29 13:44:08 -05:00
Rangi42
521ca1c34a
Use std::vector for symbols
2024-02-29 13:44:08 -05:00
Rangi42
bc8fd8a6dc
Separate union members for EQUS and MACROs
2024-02-19 08:49:04 -05:00
Sylvie
9cdd0b8a02
No more anonymous structs (not standard C++) ( #1305 )
...
This is one step to restoring `-pedantic` builds
2024-02-19 08:12:20 +01:00
Sylvie
d71a161bc9
Phrase error messages as "Failed to", not "Could not" or "Couldn't" ( #1298 )
2024-02-18 14:52:31 +01:00
Eldred Habert
fd78a9ae83
Port linkerscript parser to Bison ( #1266 )
...
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead
---------
Co-authored-by: Rangi42 <remy.oukaour+rangi42@gmail.com >
2023-12-11 02:29:37 +01:00
Rangi
cee3d1c859
Add more test coverage for RGBASM ( #1256 )
...
This also fixes two bugs: `-1 >>> 32` was -1 not 0, and `macro_FreeArgs` should have been called but wasn't.
2023-11-29 15:16:05 -05:00
Rangi
1e70e703a7
Build everything as C++ ( #1176 )
2023-11-07 21:45:56 +01:00