Commit Graph

257 Commits

Author SHA1 Message Date
Rangi
e31bcabbaa Implement === and !== string comparison operators (#1832) 2025-09-19 14:06:36 -04:00
Rangi
e0a6199f83 Allow charmap to map 'characters' as well as "strings" (#1830) 2025-09-16 12:51:07 +02:00
Rangi42
c798500563 Don't call rpn.clear() when we can safely assume it's already empty() 2025-09-03 21:02:57 -04:00
Rangi
b7e0783ae7 Implement ? suffix to "quiet" a context and exclude it from backtraces (#1800) 2025-08-18 21:34:58 -04:00
Rangi
7b405513d9 Make quote marks consistent in error/warning messages (#1791)
- "Double quotes" for strings (filenames, section names, CLI option arguments, etc)
- 'Single quotes' for characters and CLI option flags
- `Backticks` for keywords and identifiers (symbol names, charmap names, etc)

CLI option flags also have their leading dashes
2025-08-12 15:24:21 -04:00
Rangi
978e832914 Allow :: to join instructions *and* data declarations (#1785) 2025-08-11 08:04:42 -04:00
Rangi42
3a0a4b7f90 Deprecate 1-indexed string functions 2025-08-05 16:58:06 -04:00
Rangi
39f0f9edc0 Remove previously deprecated features (#1777)
- Treating multi-unit strings as numbers
- `rgbasm -Wnumeric-string`
- `ldio [c], a` and `ldio a, [c]` (use `ldh`)
- `ld [c], a` and `ld a, [c]` (use `ldh`)
- `ldh [$xx], a` and `ldh a, [$xx]` (use `$FFxx`)
2025-08-05 16:24:10 -04:00
Rangi42
fc9b614225 Allow the index of CHARVAL to be optional
Fixes #1773
2025-08-03 08:44:06 -04:00
Rangi42
7be7483571 Move more RGBASM parser action code out of the Bison file 2025-08-02 21:38:13 -04:00
Rangi42
a353637a90 Split RGBLINK linkerscript parser functions into their own file 2025-07-27 11:31:25 -04:00
Rangi42
f3cbfcecf4 Split RGBASM parser action functions into their own file 2025-07-26 16:20:25 -04:00
Rangi42
d6a28a6259 Prefer pre-increment/decrement operators in for loops 2025-07-24 18:08:17 -04:00
Rangi42
d1493a9f96 Group extern RGBASM variables in an Options struct 2025-07-21 19:02:21 -04:00
Rangi42
14f5e16ae8 Prefer pre-inc/dec unless post-inc/dec are necessary 2025-07-19 16:18:35 -04:00
Rangi
53c39d01d4 Implement READFILE function (#1759) 2025-07-18 18:27:52 -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
Rangi42
b80b30fba1 Ensure that INCBIN parameters are non-negative 2025-07-18 12:44:27 -04:00
Rangi
4c8724899b Support SIZEOF(reg) to distinguish 8- and 16-bit registers (#1758) 2025-07-17 15:49:28 -04:00
Rangi42
2720224890 Refactor parsing of ld hl, sp + e8 2025-07-15 21:52:22 -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
Rangi
8a19c5c30a Fix string function behavior with NUL characters (#1746) 2025-07-14 21:43:32 -04:00
Rangi
510a4aa99d Add RGBASM -MC flag to continue -MG after missing dependency files (#1687) 2025-07-10 13:25:36 -04:00
Rangi
a40109e4e4 Update the UTF-8 decoder (#1741) 2025-07-09 23:13:30 -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
Rangi42
612cf3b7dd Fix some formatting 2025-06-12 17:27:08 -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
e95ac6fb06 Recover from errors even inside REPT/FOR loops (#1683) 2025-05-04 17:51:53 -04:00
Rangi
e1ae92709c Fix STRSLICE with no stop index argument (#1682) 2025-05-04 16:56:25 -04:00
Rangi
2e6e1ccf06 Show specific messages for some more invalid instructions, not just "syntax error" (#1679) 2025-05-03 12:31:00 -04: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
ad4d9da4cf Remove unnecessary default constructor definitions 2025-02-14 18:58:34 +01:00
Rangi
2aef09c8d9 Allow the bit/res/set bit index to be determined at link time (#1654)
This increments the object file revision number from 11 to 12
since it adds a new `RPN_BIT_INDEX` command.
2025-02-12 17:14:10 +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
Rangi42
d9d381cb62 Refactor the parser to have fewer *_no_str intermediate rules 2025-02-04 18:59:11 +01:00
Rangi
375adc6804 Fix STRLEN and STRSUB on incomplete UTF-8 (#1633) 2025-01-28 13:13:35 -05:00
Rangi42
e49291b7cf Refactor readUTF8Char into charmap_ConvertNext 2025-01-28 00:07:08 -05:00
Rangi42
4e44958d26 Add braces to Bison .y files 2025-01-27 20:12:12 -05:00
Rangi42
192fc808c8 Run clang-format on some Bison .y file contents 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
84f59e14ed Rename Z80 prefix to SM83 2025-01-24 12:11:46 -05:00
Rangi
2426068409 Undeprecate ld [$ff00+c] (#1619) 2025-01-20 14:05:15 -05:00
Rangi42
fac5e35d24 Prefer empty braces to semicolons for empty loop bodies 2025-01-17 00:20:33 -05:00