Commit Graph

578 Commits

Author SHA1 Message Date
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
Rangi
177a3abfac Fix bug where macro names can be treated as numeric symbols (#1653) 2025-02-08 23:03:21 +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
03452c6d4f Allow git describe to get the version for FreeBSD and Cygwin in CI (#1640)
* Specify `safe.directory`
* Fetch tags
* Fetch all commits
2025-01-29 19:57:15 -05:00
Rangi
f61019dd68 Add more RGBLINK test coverage (#1637) 2025-01-29 11:41:08 -05: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
Rangi
a59867cd78 Consistently use LF line endings in expected .out and .err output (#1635)
Test scripts compare files as text
2025-01-28 21:24:40 -05:00
Rangi
375adc6804 Fix STRLEN and STRSUB on incomplete UTF-8 (#1633) 2025-01-28 13:13:35 -05:00
Rangi
44caffe04a Fix CHARLEN and CHARSUB on invalid UTF-8 (#1630) 2025-01-28 02:01:18 -05:00
Rangi42
34a9c8e083 Add some more string test cases 2025-01-28 00:02:25 -05:00
Rangi
20c18256ed Avoid errors after missing INCLUDE with -MG (#1627) 2025-01-25 12:38:17 -05:00
Rangi42
91d7ce5e09 Add test case for expansions changing context 2025-01-21 21:47:22 -05:00
Rangi
2426068409 Undeprecate ld [$ff00+c] (#1619) 2025-01-20 14:05:15 -05:00
Rangi42
4e2464a69d Replace some #define with constexpr 2025-01-04 03:53:59 -05:00
Rangi
8363f25d47 Enable more sanitizers in make develop (#1588)
- `-fsanitize=undefined` encompasses multiple checks we were specifying

- "detect_leaks=1" for `__asan_default_options` checks for memory leaks
  (except for with macOS clang++, which does not support LSan)

- `-fsanitize=float-divide-by-zero` is an extra UBSan check
  (and reveals a UB bug to fix with fixed-point `DIV` and `LOG`)
2024-12-31 10:02:20 +01:00
Sylvie
c1c5b10082 Deprecate LDH with $00-$FF (#1575) 2024-12-10 21:27:37 -05:00
Sylvie
f44de0c7ae Deprecate LD with [C] (#1574) 2024-12-10 21:13:09 -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
0b147c9386 Fix ** right-associativity, and clarify docs (#1566) 2024-12-03 20:40:50 -05:00
Rangi42
a27f704c25 Implement -Wunmatched-directive 2024-11-28 20:30:38 +01:00
Sylvie
5efd303b7f Allow LOAD FRAGMENT (#1552)
This was implemented in #736 but removed after discussion in #869.

Fixes #1537
2024-10-24 19:45:44 -04:00
Sylvie
7fcf4ba60f Correctly recover from syntax errors at the first token of a line (#1549) 2024-10-22 21:01:44 +02:00
Sylvie
3b3263273c Make ENDL optional like ENDSECTION (#1538)
Add warning for `LOAD` without `ENDL`
2024-10-15 21:13:50 -04:00
Sylvie
a2ff653a83 Fix nested undefined interpolation segfault (#1542) 2024-10-16 00:09:47 +02:00
Sylvie
a13723c523 Implement 0x/0o/0b number prefixes (#1533) 2024-10-08 15:56:00 -04:00
Rangi42
a9e49a09fd Allow tab character after backslash line continuation 2024-10-01 22:41:55 -04:00
Sylvie
d5159f66be -Wall enables -Wcharmap-redef, and document -Wnested-comment (#1528) 2024-09-30 14:34:58 -04:00
Sylvie
22767e36e2 Refer to "end of line", not "newline" (#1517) 2024-09-23 02:15:02 +02:00
Sylvie
6b89938da7 Avoid treating labels and macros differently in column 1 (#1515)
Fixes #1512
2024-09-23 01:26:25 +02:00
Sylvie
15919e550f Add test to demonstrate lack of expansions in skipIfBlock (#1516) 2024-09-22 15:31:12 -04:00
Sylvie
9ef2e43bf7 Track local label scope, string equated as .. (#1504) 2024-09-18 09:52:30 -04:00
Sylvie
122ef95d9c Implement . string constant for the current label scope (#1499) 2024-09-13 21:20:01 +02:00
Sylvie
bfb96b038d Make error messages for "undefined" built-ins more accurate (#1501) 2024-09-11 17:54:23 +02:00
Rangi42
6e83a14143 Consistently handle auto-scoping of local symbols 2024-09-10 21:38:50 +02:00
Rangi42
6bc2446966 Rephrase error messages for consistency 2024-09-10 21:38:50 +02: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
Rangi42
068ad93427 Allow syntax cpl a 2024-09-06 21:35:17 +02:00
ISSOtm
610f04beeb Fix condition for assuming at EOF
Part of that condition's purpose is to ensure that we read the correct
lexer state; but it's possible now for the fstack to be non-empty
*before* the lexer state is registered, i.e. if there is an error
in the function that registers it.
This causes a NULL pointer deref.
2024-09-05 17:48:52 +02:00
ISSOtm
e289387b09 Avoid attempting to link if assembling fails 2024-09-05 17:19:05 +02:00
Sylvie
1283b0b6a6 Allow dollar signs in identifiers (#1493) 2024-09-03 23:09:06 +02:00
Sylvie
6b8d33529e Improve string/interpolation formatting (#1491)
- The '#' component for type 's' now escapes the string characters
- The '#' component for type 'f' now prints a precision suffix
- The new 'q' component specifies a precision value
2024-09-01 12:54:26 -04:00
Rangi42
c07371c9fc Revert "Show test issues as annotations in the GitHub Actions job summary"
This reverts commit 3a5ff35928.

Annotations were not actually appearing.
<https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions>
2024-08-27 14:07:35 -04:00
Rangi42
3a5ff35928 Show test issues as annotations in the GitHub Actions job summary 2024-08-27 01:02:53 -04:00
ISSOtm
4ce6c9f4a5 Avoid bogus comparisons when linking fails
This avoids drowning RGBLINK's errors in a meaningless `diff` output
2024-08-26 22:58:38 -04:00
Sylvie
44332ff4be Charmaps cannot map an empty string (#1486) 2024-08-22 13:21:16 -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
b438c83bda Implement a '#' prefix for raw identifiers that may alias keywords (#1480)
* Implement a '#' prefix for raw identifiers that may alias keywords

* Review comments

* Disallow hashless raw identifiers in interpolations

* Run clang-format
2024-08-21 19:31:44 +02:00
Sylvie
8c96293b11 Test the RGBASM state file output (#1472) 2024-08-19 20:13:27 +02:00
Rangi42
731715ff36 Refactor test.sh scripts for consistency 2024-08-18 21:38:45 -04:00