Rangi
b7e0783ae7
Implement ? suffix to "quiet" a context and exclude it from backtraces ( #1800 )
2025-08-18 21:34:58 -04:00
Rangi42
ea1358bbe6
Predef std::pair to two-element std::tuple
2025-08-13 20:48:54 -04:00
Rangi
5f8b7474b4
Add -B/--backtrace option to RGBASM and RGBLINK ( #1787 )
2025-08-11 14:30:14 -04:00
Rangi
752b273aec
Extend RGBASM and RGBLINK verbosity flags to have multiple levels like RGBGFX ( #1772 )
2025-08-02 17:10:10 -04:00
Rangi42
8d268e8a8a
Initialize maxRecursionDepth with other options
2025-07-21 19:58:37 -04:00
Rangi42
61730be6ce
Make failedOnMissingInclude not extern
2025-07-21 19:40:01 -04:00
Rangi42
d1493a9f96
Group extern RGBASM variables in an Options struct
2025-07-21 19:02:21 -04:00
Rangi42
9ef32e405c
Combine two places that did REPT chain printing
2025-07-20 15:16:53 -04:00
Rangi
2935942667
Allow multiple preinclude files ( #1763 )
2025-07-19 17:07:15 -04:00
Rangi42
e7d63f5f6b
Refactor code that handles when included files are missing
...
- Single unified routine for erroring out or handling missing dependencies
- Single three-state enum instead of two Booleans for missing dependencies
(this causes `-MC` to imply `-MG` instead of needing `-MG -MC`)
- Functions than can miss included files return a Boolean for whether the
parser should `YYACCEPT` and exit
2025-07-18 14:03:23 -04:00
Rangi
5e43ece578
Remove errx and errors.hpp ( #1737 )
2025-07-09 11:04:23 -04:00
Rangi
fda54fd0c3
Replace Either with std::variant ( #1731 )
2025-07-08 13:59:03 -04:00
Rangi
e95ac6fb06
Recover from errors even inside REPT/FOR loops ( #1683 )
2025-05-04 17:51:53 -04:00
Rangi42
b8b60207f5
Use // line comments not /* block comments
2025-01-27 20:12:12 -05:00
Rangi42
f23a14afc7
Remove unnecessary semicolons after closing braces
2025-01-17 00:01:06 -05:00
Rangi42
a5f12f66bb
Define the default -recursion depth in main.cpp with other default values
2025-01-04 03:53:59 -05:00
Rangi
73ad431b8d
Fix the node type for "file" nodes in object files ( #1593 )
2025-01-03 17:20:06 +01:00
Sylvie
b877c81c32
Use C++-style casts ( #1576 )
2024-12-09 21:56:54 -05:00
Rangi42
8cd0e66297
Revert "Implement INCLUDE_ONCE directive ( #1481 )"
...
This reverts commit 5f07095f6d .
2024-09-08 11:30:31 -04:00
sukus
5f07095f6d
Implement INCLUDE_ONCE directive ( #1481 )
...
Identify files by (device, inode), not by path, so that symlinks,
relative paths, case-insensitive paths, or other edge cases
do not result in double includes.
2024-09-08 00:02:02 -04:00
Sylvie
57c3d74b9e
Use a custom generic tagged union Either instead of std::variant for efficiency ( #1476 )
...
* Implement custom generic tagged union `Either`
This should be more efficient than `std::variant`, while still
keeping runtime safety as it `assert`s when `get`ting values.
* Use `Either` for RPN expressions
* Use `Either` for file stack node data
* Use `Either` for `File` buffer
* Use `Either` for `STRFMT` args
* Use `Either` for RGBLINK symbol values
* Support an equivalent of `std::monostate` for `Either`
* Use `Either` for lexer tokens
* Use `Either` for symbol values
* Use `Either` for lexer mmap/buffer state
2024-08-20 21:19:11 +02:00
Rangi42
b8387427a6
Use consistent RGBDS_<PROG>_<NAME>_HPP header guard convention
2024-04-14 21:50:05 -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
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