Commit Graph

556 Commits

Author SHA1 Message Date
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
Rangi42
7cf4156003 Add some more tests, and fix some existing ones 2024-08-18 21:38:45 -04:00
Rangi42
ee3a93a442 Test macro args \0 and \<0> 2024-08-18 21:38:45 -04:00
Sylvie
2d530dbcd6 Fix constant expression detection functions (#1462) 2024-08-09 09:40:53 +02:00
Sylvie
e93190d491 Implement BITWIDTH and TZCOUNT functions (#1450) 2024-08-07 10:39:30 -04:00
Sylvie
7435630d6a Error messages note when a symbol has been purged (#1453) 2024-08-06 15:35:06 -04:00
Sylvie
bb480b761c Rephrase numeric-string warning to not be identical to another one (#1449) 2024-08-06 13:56:09 +02:00
Sylvie
2706f94788 Multiple fixes and enhancements to RPN behavior: (#1448)
- FIX: `Label & const` was not actually doing the `& const` masking
  (fixes #1446)
- ADD: `LOW(Label)` can be constant if `Label` is aligned to 8 or more bits
  (resolves #1444)
- ADD: `!expr` can be constant 0 if `expr` has any non-zero bits
  (resolves #1447)
- `LOW()` and `HIGH()` have their own RPN operator values
  (resolves #1445)

The change to RPN values means that the object file version was incremented.

This also refactors unary operators and functions, combining their
evaluation similarly to binary ones.
2024-08-06 13:54:55 +02:00
Sylvie
2f8f99bd94 Implement -Wpurge= (#1443) 2024-08-05 12:50:48 -04:00
Sylvie
c5e6a815fa Deprecate treating multi-unit strings as numbers (#1438) 2024-08-05 16:05:50 +02:00
Sylvie
9a5b3f0902 Implement multi-value charmaps (#1429) 2024-08-04 23:32:08 +02:00
Sylvie
92abe24894 Implement EXPORT DEF to define and export symbols (#1422) 2024-07-25 17:40:58 -04:00
Sylvie
13a8895fca Improve the error messages for interpolating undefined or invalid symbols (#1423) 2024-07-25 17:36:02 -04:00
Sylvie
e179ba5fd3 Add syntax to push and modify stacks in one line (#1421) 2024-07-25 23:14:59 +02:00
Sylvie
623c3f662c Allow NUL characters in strings (#1405) 2024-06-18 14:26:18 -04:00
Sylvie
8c3ca462fe Add more test cases (#1409) 2024-06-17 15:07:35 -04:00
Sylvie
dfec7111e2 X && 0 and X & 0 are constant 0; X || 1 is constant 1 (#1399)
Fixes #977
2024-06-13 11:09:39 -04:00
Sylvie
3e9d2cab12 Make some error messages more consistent (#1393)
* Update some error messages

* Make non-A destination operand syntactically invalid
2024-04-20 23:13:01 +02:00
Sylvie
9ab3446d1a Fix two bugs with RGBASM fixed-point math (#1388)
- Fixed-point formulas are implemented using IEEE-754 floating-point
  internally, which could give infinity or NaN values whose conversion
  to fixed-point integer was platform-dependent.
- Formatting fixed-point $8000_0000 (INT32_MIN, -2147483648) was
  not putting the negative sign in front.
2024-03-31 12:53:20 -04:00
Rangi42
230b1db438 Remove deprecated DEF-less definitions 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
Sylvie
96c808810f Remove .simple.err files, since we require Bison 3.0 (#1373) 2024-03-22 15:36:32 -04:00
Rangi42
507439bc25 Refactor macro args to be owned collectively by their fstack contexts 2024-03-22 14:25:36 -04:00