Commit Graph

191 Commits

Author SHA1 Message Date
Rangi42
8d1b111692 Small lexer refactors, commenting when tail recursion occurs 2025-07-20 00:14:13 -04:00
Rangi42
14f5e16ae8 Prefer pre-inc/dec unless post-inc/dec are necessary 2025-07-19 16:18:35 -04:00
Rangi42
bf69043a1d Reduce deep nesting some more 2025-07-19 16:18:30 -04:00
Rangi
53c39d01d4 Implement READFILE function (#1759) 2025-07-18 18:27:52 -04:00
Rangi
0c96234532 Use concrete types instead of auto when convenient and not redundant (#1757) 2025-07-17 14:59:51 -04:00
Rangi
1fecf80659 Implement 'character' literals (#1747) 2025-07-15 13:08:50 -04:00
Rangi
b6d77fbb9e Implement BYTELEN and STRBYTE (#1744) 2025-07-14 21:46:35 -04:00
Rangi42
0149122cd0 Note how to print lexed token names for future reference 2025-07-14 10:25:47 -04:00
Rangi42
35335aadbe Add test for labels when expecting symbols 2025-07-14 00:10:14 -04:00
Rangi42
80df858ee3 Clarify comment 2025-07-14 00:02:25 -04:00
Rangi42
eafc32fd68 Simplify switch with one case to if 2025-07-13 23:48:01 -04:00
Rangi42
21a6d35b8b Simplify readString 2025-07-13 13:26:59 -04:00
Rangi42
ce78280af3 Simplify appendCharInLiteral 2025-07-13 13:22:40 -04:00
Rangi42
041b86b8dd Use Defer instead of relying on a "Don't return before this" comment 2025-07-13 12:52:45 -04:00
Rangi42
da133baf17 Reduce nesting depth in lexer.cpp 2025-07-12 07:54:16 -04:00
Rangi42
d32b1912ed Use verbosePrint in rgbasm as well as rgblink 2025-07-12 01:38:19 -04:00
Rangi42
82513e5255 Simplify appendCharInLiteral 2025-07-11 23:52:52 -04:00
Rangi42
f2708ce967 Consolidate readString and appendStringLiteral 2025-07-11 23:43:36 -04:00
Rangi42
01a5c94c7e Factor out common code from readString and appendStringLiteral 2025-07-11 22:37:28 -04:00
Rangi
34cf959c9d Refactor to reduce nesting depth some more (#1740) 2025-07-09 22:46:40 -04:00
Rangi
44f5b47bf0 Reduce nesting depth in some functions (#1739) 2025-07-09 16:20:33 -04:00
Rangi
41ab5dff5a Implement [[ fragment literals ]] (#1614)
This feature is referred to as "code/data literals" in ASMotor,
and simply as "literals" in some older assemblers like MIDAS
for the PDP-10. RGBASM already had the "section fragments"
feature for keeping disparate contents together when linked,
so these worked naturally as "fragment literals".
2025-07-09 12:13:01 -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
35962dedc4 Refactor warnings and errors (#1728)
* Remove `err` and `warn`, keep `errx` and `warnx`, using them in RGBGFX too

* Separate RGBGFX and RGBLINK warnings/errors from main options

* Separate `report` function into `error` and `fatal` messages

* Implicit newlines for most RGBASM errors
2025-07-08 12:58:23 -04:00
Rangi
089e366ddc Implement CHARVAL function (#1701) 2025-06-12 17:21:12 -04:00
Rangi
fa9e29e4ce Implement ++ operator for string concatenation (#1698) 2025-06-12 22:52:00 +02:00
Rangi
5d998ef483 Restrict custom binary and graphics digits (#1693)
* Restrict custom binary and graphics digits

* Update documentation

* Fix build error
2025-05-22 10:52:51 +02:00
Rangi
126b1e5726 Reuse startsIdentifier and continuesIdentifier functions (#1695) 2025-05-19 15:31:26 -04:00
Rangi
e45b9625ca Group sequences of garbage characters (#1672) 2025-04-30 23:31:41 -04:00
Rangi
0b7cda9e0c Allow negative values to count macro arguments from the end (#1670) 2025-04-20 00:37:50 -04:00
Rangi42
2cdbb145da Avoid use of goto in shiftChar 2025-02-27 14:17:01 -05:00
Rangi
632342b254 Use LCOV_EXCL comments to exclude some lines from test coverage (#1662) 2025-02-16 13:56:55 -05:00
Rangi
b2e865ee2a Disable EQUS expansion for raw symbols (by parsing them as strings) (#1648) 2025-02-15 10:44:51 +01:00
Rangi
3feb75f84f Implement new string functions (#1655)
`STRFIND`, `STRRFIND`, `STRCHAR`, `STRSLICE`, `CHARCMP`, `CHARSIZE`, and `REVCHAR`
2025-02-14 23:09:45 +01:00
Rangi42
48412e9c56 Some miscellaneous refactoring and copy-editing 2025-02-10 16:51:51 +01:00
Rangi
4c916b8da8 Parser refers to "symbol"s, "label"s, and "local label"s, not "identifier"s (#1652)
This better matches how the lexed tokens are discussed in rgbasm(5)
2025-02-06 18:01:33 +01:00
Rangi
c19ddc80f0 Fix failing assertion with backslash at EOF in macro arguments (#1634)
`Expansion::advance()` can increase its offset beyond the size,
so I don't think this assumption was valid in the first place;
`BufferedContent::advance()` should be able to as well.
2025-01-28 21:51:11 -05:00
Rangi42
d54619a453 Remove colNo column tracking from lexer
This was added as part of 71f88717 just for debug and fstack trace
output, but we no longer output it anyway.
2025-01-28 01:12:18 -05:00
Rangi42
cae31005f8 Always use braces with InsertBraces: true in .clang-format 2025-01-27 20:12:12 -05:00
Rangi42
01c9106b59 Include windows.h before other Win32 header files 2025-01-27 20:12:12 -05:00
Rangi42
b8b60207f5 Use // line comments not /* block comments 2025-01-27 20:12:12 -05:00
Rangi42
a354af3d08 Reformat source files with clang-format 19.1.7 2025-01-27 20:12:12 -05:00
Rangi42
890528812e Prefer C++ constructs to C-style sizeof-based macros 2025-01-24 18:56:41 -05:00
Rangi42
84f59e14ed Rename Z80 prefix to SM83 2025-01-24 12:11:46 -05:00
Rangi42
0ee4ba95b3 Replace old-style cast in Windows-only code with static_cast 2025-01-16 23:41:12 -05:00
Rangi42
4e2464a69d Replace some #define with constexpr 2025-01-04 03:53:59 -05:00
Sylvie
b877c81c32 Use C++-style casts (#1576) 2024-12-09 21:56:54 -05:00
Sylvie
573e044b30 Deprecate LDIO (#1567)
* Deprecate `LDIO`

* `ld [$ff00+n8], a` is not treated as `ldh [n8], a`
2024-12-05 12:49:13 -05:00
Sylvie
a2ff653a83 Fix nested undefined interpolation segfault (#1542) 2024-10-16 00:09:47 +02:00