Commit Graph

41 Commits

Author SHA1 Message Date
Rangi
d9654b752f Support -h/--help for all programs (#1620) 2025-01-21 21:24:17 -05:00
Rangi42
a5f12f66bb Define the default -recursion depth in main.cpp with other default values 2025-01-04 03:53:59 -05:00
Sylvie
b877c81c32 Use C++-style casts (#1576) 2024-12-09 21:56:54 -05:00
Rangi42
a27f704c25 Implement -Wunmatched-directive 2024-11-28 20:30:38 +01:00
Sylvie
3b3263273c Make ENDL optional like ENDSECTION (#1538)
Add warning for `LOAD` without `ENDL`
2024-10-15 21:13:50 -04:00
Sylvie
cf85146353 Refactoring and enhancements to RGBASM warnings (#1526)
* Allow a `no-` prefix to negate "meta" warnings
  (`-Wno-all`, `-Wno-extra`, `-Wno-everything`)
* Allow `-Wno-error=...` to override `-Werror`
  (including for "meta" warnings)
2024-10-04 21:52:40 +02:00
Rangi42
26fcff831d Run clang-format 2024-08-27 01:49:05 -04:00
Sylvie
0e8a17ce82 Report any section overflows at the end of assembly (#1482)
* Report any section overflows at the end of assembly

* Immediately handle overflow of the 32-bit size counter
2024-08-22 18:51:52 +02:00
Sylvie
f304e1dd7f Implement state file output for RGBASM (#1435) 2024-08-05 12:41:40 -04:00
Sylvie
d4231f9efa Remove redundant "unknown option" error messages (#1441)
`getopt` already prints "unrecognized option"
2024-08-05 16:04:53 +02:00
Rangi42
4e0f794c23 More refactoring and renaming 2024-07-26 20:12:51 -04:00
Sylvie
6a65cbc9ed Some refactoring and reformatting (#1431) 2024-07-26 11:51:27 -04:00
Sylvie
ee748cfe26 Miscellaneous refactoring of code and docs (#1411) 2024-06-18 20:47:31 +02:00
Rangi42
eb708ebee5 Rename some variables left from the C parser (e.g. yylval) 2024-03-29 19:42:23 -04:00
Rangi42
b021090e7f Remove deprecated -i for --include (use -I) 2024-03-28 17:26:42 -04:00
Rangi42
14b72222b1 Remove the deprecated -H/-h/-L/-l options 2024-03-28 17:26:42 -04:00
ISSOtm
cae7b5dcf6 Use standard attribute syntax instead of IBM __attribute__
Move format attrs to proper standard location

For some reason, GCC 13 is more lax than earlier versions...
2024-03-27 20:01:12 -04:00
Rangi42
dcb4e40388 Use QUOTEDSTRLEN macro instead of sizeof or strlen 2024-03-27 11:50:48 -04:00
Rangi42
912a1504ec Defer closing of depend file 2024-03-27 11:44:26 -04:00
Rangi42
2ef5e807f8 No more memory leaks! 2024-03-27 11:27:34 -04:00
ISSOtm
9f239f6dcc Use std::shared_ptr<std::string> for lexed/parsed strings 2024-03-22 14:25:36 -04:00
Rangi42
e96675be03 Pass std::string references to fstack functions 2024-03-18 14:42:05 -04:00
Rangi42
6cabb8c9af Pass std::string references to output functions 2024-03-18 14:42:05 -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
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
8c173b4e95 Remove declaration for compatibility with macOS bison 2.3
We've required bision 3.0 since October 2022
2024-03-06 17:58:15 -05:00
Sylvie
e74073e480 Run clang-format on everything (#1332) 2024-03-04 14:22:49 -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
beb1997378 Use std::unordered_map for the keyword dict 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
a4ed7e1d18 Use automatic allocation for charmaps 2024-02-29 13:44:08 -05:00
Rangi42
ee59f17ea1 Free all the charmaps after parsing 2024-02-19 09:00:15 -05:00
Sylvie
8a49a0b714 Report "<stdin>" or "<stdout>" when using "-" as a filename placeholder (#1297)
Also fix a memory leak with `targetFileNames`
2024-02-18 17:07:25 +01:00
Sylvie
c07f3da9a1 Provide guidance to remove the deprecated rgbasm flags (#1296)
* Explain to remove the deprecated rgbasm flags

* Rephrase deprecation warnings
2024-02-18 16:16:15 +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
Sylvie
66fd5a7062 Fix some usually disabled compiler warnings (#1286)
* Fixes from temporarily re-enabling more compiler warnings

* More edits suggested by cppcheck

* Fix hanging on append_yylval_string

* Fix FOR loop increment
2024-01-18 20:47:20 +01:00
Rangi
34b2543c8b Implement -X/--max-errors for RGBASM (#1262)
Co-authored-by: Eldred Habert <me@eldred.fr>
2023-12-07 11:42:47 +01:00
Rangi
1e70e703a7 Build everything as C++ (#1176) 2023-11-07 21:45:56 +01:00