Commit Graph

3478 Commits

Author SHA1 Message Date
Rangi 996469ee28 Ensure CRLF line endings are preserved when necessary
Some test cases need CRLF line endings checked out even on Unix.
Also some source files had inadvertently contained CR bytes.
2026-05-25 22:00:45 -04:00
Rangi 55db252a8f Simplify the lexer by removing BufferedContent and inlining ViewedContent (#1981)
Instead of reading 64 characters at a time into a rolling buffer
as `shiftChar()` is called, we read 8192 characters at a time into
a complete buffer before any `peek()`/`shiftChar()` operations.
2026-05-25 21:05:59 -04:00
Rangi cfa0adf295 Intern strings used as identifiers (for labels, constants, macros, charmaps, etc) (#1980) 2026-05-25 16:22:29 -04:00
Rangi ed19806434 Don't hard-code std::string as the key type for InsertionOrderedMap 2026-05-25 14:21:18 -04:00
Rangi a0d96a0856 Factor out repeated expandedSymName logic 2026-05-25 14:21:18 -04:00
Rangi 4b992bfea5 Use the name of sym_GetPC() instead of hard-coding "@" again 2026-05-25 14:21:14 -04:00
Rangi 141a7fe22b Add assume checks for expected Token types, like RPNValue has for RPNCommands 2026-05-25 14:14:34 -04:00
Rangi 43ffc89bb4 Correct comment SIZE_MAX to UINT16_MAX 2026-05-25 13:55:12 -04:00
Rangi 72a410c007 Encapsulate charmap_Init, like sym_Init 2026-05-25 13:54:26 -04:00
Rangi 090768e2c9 Some Expansion references can be const 2026-05-23 13:06:09 -04:00
Rangi42 5f2ee530b8 Pass -Wno-unused-but-set-variable by default, not just in make develop
The Bison-generated parser skeleton otherwise triggers this warning
with Apple clang++ for `yynerrs_`.
2026-05-23 01:40:13 -04:00
Rangi 4a173130b9 Optimize skipToLeadingKeyword for the common ViewedContent case (#1968) 2026-05-22 19:06:12 -04:00
Rangi ef2f021892 Simplify sectError handling, without the need for an empty-string sentinel
The `errorNoTrace` case for the empty-string sentinel was unreachable,
so we can just have a `fatalNoTrace` error right away.
2026-05-22 18:17:25 -04:00
Rangi dce14fd4b8 Use C++20 concepts to require constraints on template parameters (#1977) 2026-05-22 17:54:34 -04:00
Rangi 728bed39d5 Do not support GCC 9 (#1978)
This will let us use C++20 features that GCC 9's experimental
C++20 support did not yet cover, such as "concepts".

This reverts some commits:
- 6bcd79b997
- d5ce5329ea
- 728d14879b
2026-05-22 16:46:46 -04:00
Rangi 48fcd9a0ca Use templates to reduce the redundant number-lexing functions (#1963) 2026-05-21 23:13:09 +02:00
Eldred Habert 1871b0a0b8 Use Windows git for checkout's post-job cleanup, not Cygwin's git (#1953)
This fixes an error from using Cygwin's git in checkout's post-job cleanup
2026-05-21 15:25:29 -04:00
Rangi d56dbbb4bf Refactor section creation errors, and simplify output for single errors (#1964) 2026-05-21 13:01:08 -04:00
Rangi 728d14879b Consistently use -std=c++2a, not -std=c++20
Commit 63a911e657 switched
to `-std=c++20` since at the time we required GCC 10 or higher.

Commit d5ce5329ea partially reverted
to `-std=c++2a` since we once again support GCC 9, which did not
yet handle `std=c++20`.
2026-05-20 17:09:23 -04:00
ISSOtm 0ed8c2f8ee Docu-comment an implicit correctness assumption 2026-05-14 14:47:23 +02:00
ISSOtm d5186b088b Link against (non-debug) MSVC runtime statically 2026-05-14 14:47:23 +02:00
ISSOtm fee177d0b9 Link zlib and libpng statically by default
Only when we are building them ourselves, that is.
2026-05-14 14:47:23 +02:00
Rangi 42e3da837c Comment the commands to use for profiling and code coverage 2026-05-09 20:52:45 -04:00
Rangi 358e8fe636 Add more tests of lexer's skipToLeadingKeyword behavior (#1971)
The character after the ending keyword gets blue-painted.
2026-05-09 15:56:17 -04:00
Rangi c50a849757 Verbose tracing shows lexed and captured values (#1969) 2026-05-09 12:01:29 -04:00
Rangi 57111b219a Describe the wine-shim Makefile target (#1967) 2026-05-09 15:27:08 +02:00
Rangi be2d028ae6 Format getopt errors more like others (sentence case, quoted options) (#1966) 2026-05-09 13:27:34 +02:00
ISSOtm 1af8bdda16 Have CMake put RGBDS executables in our own dir
Not the top-level if we are part of a larger project!
2026-05-06 18:49:19 +02:00
ISSOtm fa22b78e7d Use type instead of which in shell scripts
The latter is not a Bash built-in,
and some environments turn out to produce non-conforming
return codes.

`type` is provided by Bash itself,
so we can rely on it better.
2026-05-05 16:03:33 +02:00
Rangi42 f0161b41c8 Update readHexNumber for consistency with other routines 2026-04-29 12:31:00 +02:00
Rangi42 ca23210f18 Refactor and rename some numeric literal lexing for asm and linkerscript consistency 2026-04-29 12:15:14 +02:00
Rangi42 85e044f5be Use std::move when relevant in Token constructor 2026-04-28 13:32:45 +02:00
Rangi42 60e76b2da4 Avoid UB if new OOMs by removing std:nothrow 2026-04-28 13:28:32 +02:00
Rangi42 3c7488c131 Some refactoring, renaming, and debug assertions for clarity and safety
- Add more `assume()` checks in the lexer
- Replace double negative "`disable* = false`" with "`enable* = true`"
- Naming convention of "`std::deque<> *Stack`" when relying on
  `.push_front()` and `.pop_back()`
2026-04-27 18:47:06 +02:00
Rangi42 9fd0c0297f Fix invalid character in bracketed macro argument
The invalid character should not be consumed by `shiftChar()`.
2026-04-27 17:11:20 +02:00
Rangi42 c1c7e64249 Add two assume calls to verify lexer arguments 2026-04-27 15:35:10 +02:00
Rangi42 a18b2f1049 Consistently lex local labels after keywords, even when skipping/capturing 2026-04-27 15:28:30 +02:00
Rangi42 3f144b7713 Add test case for local labels after block-ending keywords 2026-04-27 15:04:12 +02:00
Rangi42 eeb3a73210 Small optimization to skipToLeadingKeyword 2026-04-27 14:26:47 +02:00
ISSOtm 37d39f91f6 Build using GCC 9 in CI
Checking that we don't regress this later.
Ubuntu doesn't package GCC 8, and we don't support it either,
so that is a good compromise for now.
2026-04-26 23:30:59 +02:00
ISSOtm d5ce5329ea Fix compilation with GCC 9 2026-04-26 23:30:59 +02:00
ISSOtm 6bcd79b997 Revert "Derive operator!= from operator== (#1660)"
This reverts commit 993879a2ed.
2026-04-26 23:30:59 +02:00
ISSOtm decc5f7153 Let parallelism be determined automatically
Ninja is parallel by default;
however, it is not used on FreeBSD, so we still have to specify it there.
2026-04-20 15:32:54 +02:00
ISSOtm a3c953ea46 Pass C++ compiler to CMake via env var
This is a little terser
2026-04-20 15:32:54 +02:00
ISSOtm d43049c84d Imply CMake source dir
Shortening our command lines slightly
2026-04-20 15:32:54 +02:00
ISSOtm b6ff54acc3 Avoid libpng compilation on Windows spamming the Microsoft banner 2026-04-20 15:32:54 +02:00
ISSOtm 71fc449452 Use Ninja on Unix platforms
It has nicer UX, only showing full command lines when they fail.
It could also be slightly faster, though I've seen no measurable improvement.
2026-04-20 15:32:54 +02:00
ISSOtm 59dd1fbbf8 Correct naming of MSBuild CMake presets
You can build with MSVC without MSBuild
2026-04-20 15:32:54 +02:00
ISSOtm 2502d130eb Use Ninja on Windows
MSBuild is slow, and its output is hard to parse visually
(it's all interwoven, like Make without `--output-sync`).
Since we use CMake anyway, we don't care about the build system.
2026-04-20 15:32:54 +02:00
ISSOtm a78a268cb4 Pass convenience options to Make invoked via CMake
Can't pass them to plain Make invocations,
because we try to be compatible with macOS' old Make.
2026-04-20 15:32:54 +02:00