Commit Graph
100 Commits
Author SHA1 Message Date
Rangi42 a9e49a09fd Allow tab character after backslash line continuation 2024-10-01 22:41:55 -04:00
Rangi42 e1ac7f389d Correct some documentation of RGBASM warnings 2024-09-30 15:58:09 -04:00
Rangi42 c7a029a051 Remove duplicated condition check 2024-09-30 10:47:57 -04:00
Rangi42 8037b9e10a Run clang-format 2024-09-25 13:15:58 -04:00
Rangi42 7c74653aa1 Fix swapped warning comments 2024-09-25 11:25:03 -04:00
Rangi42 5d3e96662e Only publish container for gbdev 2024-09-21 10:06:23 -04:00
Rangi42 91580043e0 Use latest docker/login-action 2024-09-21 09:59:28 -04:00
Rangi42 b03a5b13b7 Clarify when to manually publish prerelease docs 2024-09-18 12:40:08 -04:00
Rangi42 dd20012e88 Release 0.9.0-rc1 2024-09-18 10:15:38 -04:00
Rangi42 91fbece1ad Update man page and license copyright dates 2024-09-18 10:01:39 -04:00
Rangi42 0597ff82e3 Update test dependencies 2024-09-18 09:59:00 -04:00
Rangi42 9b3d19c3f2 Prefer snprintf to sprintf
This also simplifies advancing `ptr`
2024-09-15 00:01:09 -04:00
Rangi42 02439b18c0 \# will always be defined inside macros
This lets the case structure here match the other branches
2024-09-15 00:00:00 -04:00
Rangi42 1adf68d018 Refer to "label scope", not "symbol scope" 2024-09-10 21:38:50 +02:00
Rangi42 750e69c5a6 More asserts like the one in addLabel 2024-09-10 21:38:50 +02:00
Rangi42 6e83a14143 Consistently handle auto-scoping of local symbols 2024-09-10 21:38:50 +02:00
Rangi42 cff05435ad Remove redundant and sometimes inaccurate comments 2024-09-10 21:38:50 +02:00
Rangi42 3b59e8963e Rename variables to avoid C++ reserved "_[A-Z]" prefix 2024-09-10 21:38:50 +02:00
Rangi42 56af572bfd Refactor symbol value getters for less redundancy 2024-09-10 21:38:50 +02:00
Rangi42 6bc2446966 Rephrase error messages for consistency 2024-09-10 21:38:50 +02:00
Rangi42 155e7287db Store a pointer to the scoped label, not just its name 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
Rangi42 11f0e88b30 Factor out common sanity checks for section union and fragment 2024-09-06 21:55:28 -04:00
Rangi42 d917df406d Use camelCase instead of lowercase for static functions 2024-09-06 21:48:57 -04:00
Rangi42 7960a10228 These extensions should be binary 2024-09-06 21:35:17 +02:00
Rangi42 068ad93427 Allow syntax cpl a 2024-09-06 21:35:17 +02:00
Rangi42 a098213053 Rearrange switches so default cases are last 2024-09-01 13:00:04 -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 15f0871683 Update some names and comments 2024-08-27 14:04:52 -04:00
Rangi42 26fcff831d Run clang-format 2024-08-27 01:49:05 -04:00
Rangi42 3a5ff35928 Show test issues as annotations in the GitHub Actions job summary 2024-08-27 01:02:53 -04:00
Rangi42 38a90890fb A few more rgbasm documentation tweaks 2024-08-27 01:02:06 -04:00
Rangi42 de84e3ea8b Rewrite and rearrange some rgbasm docs 2024-08-27 00:48:49 -04:00
Rangi42 b77ba1d87d Forward declare struct Section to avoid a nested header include 2024-08-26 22:58:38 -04:00
Rangi42 fbe28e0def Remove outdated "absolute data" terminology in function names 2024-08-26 22:58:38 -04:00
Rangi42 7bc9a24bf0 Edit some documentation of unions and macros 2024-08-22 00:41:07 -04:00
Rangi42 b7290366cb Reword some RGBASM docs 2024-08-18 21:38:45 -04: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
Rangi42 c42e856efb Fix charmap state output for inherited characters 2024-08-09 22:13:43 -04:00
Rangi42 0adff57e2c Sync warning flags between Makefile and CMakeLists.txt 2024-08-08 16:02:11 -04:00
Rangi42 e4ffcf7153 Update the 'ucity' commit used for testing
This removes our need to patch it for compatibility
2024-08-04 21:52:57 -04:00
Rangi42 436580a649 Consistently use "palette spec" not "color spec"
Fixes #1436
2024-08-04 16:24:14 -04:00
Rangi42 3bd35a8848 "Write" to files, "print" to console 2024-08-02 16:26:42 -04:00
Rangi42 0ed846c773 Remove outdated RGBASM options from man page 2024-07-27 09:57:52 -04:00
Rangi42 4e0f794c23 More refactoring and renaming 2024-07-26 20:12:51 -04:00
Rangi42 556c8a968a Release 0.8.0 2024-06-28 14:53:17 -04:00
Rangi42 39e9315e8a Use a smaller size for the lexer buffer
Large sizes are more efficient when it's actually buffered,
but most of the time `mmap` is used instead, and the extra size
just slows down allocation of lexer states.
2024-05-17 20:59:42 -04:00
Rangi42 b8387427a6 Use consistent RGBDS_<PROG>_<NAME>_HPP header guard convention 2024-04-14 21:50:05 -04:00
Rangi42 6b5248f15b Add a build target for include-what-you-use 2024-03-29 20:49:09 -04:00
Rangi42 eb708ebee5 Rename some variables left from the C parser (e.g. yylval) 2024-03-29 19:42:23 -04:00
Rangi42 cf3e5e15f8 Update the 'ucity' commit used for testing
This reduces our need to patch it for compatibility
2024-03-29 14:42:23 -04:00
Rangi42 17afe611fd Update the 'libbet' commit used for testing
This reduces our need to patch it for compatibility
2024-03-29 13:35:12 -04:00
Rangi42 9dac583e45 Patch test projects so they build without deprecated features
Also ensure the test scripts pass shellcheck
2024-03-28 17:26:42 -04:00
Rangi42 ccfd3b6af8 Remove documentation of already-removed RGBGFX options 2024-03-28 17:26:42 -04:00
Rangi42 4a4656af1b Remove the deprecated RGBGFX --output-* options (use --auto-*) 2024-03-28 17:26:42 -04:00
Rangi42 b021090e7f Remove deprecated -i for --include (use -I) 2024-03-28 17:26:42 -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
Rangi42 106e516962 Split the .peek() method into its next-char and lookahead cases 2024-03-28 15:37:25 -04:00
Rangi42 6f74e4fb9c Remove the suboptimal .canPeek() and .peek() methods 2024-03-28 14:49:36 -04:00
Rangi42 83c0634f15 Refactor peekInternal to be a LexerState method 2024-03-28 13:21:28 -04:00
Rangi42 4172d330b9 Refactor BufferedContent and Expansion to have methods
Use a buffer size that is a power of two for fast modulus
2024-03-28 12:57:23 -04:00
Rangi42 cf7bdb19b6 Run clang-format 14 on everything
Later versions may need some proprties added or changed to not
format closing braces weirdly.
2024-03-28 09:17:27 -04:00
Rangi42 506911d7d0 Refactor to avoid redundant obj_CheckAssertions function 2024-03-27 16:19:01 -04:00
Rangi42 dcb4e40388 Use QUOTEDSTRLEN macro instead of sizeof or strlen 2024-03-27 11:50:48 -04:00
Rangi42 912a1504ec Defer closing of depend file 2024-03-27 11:44:26 -04:00
Rangi42 2ef5e807f8 No more memory leaks! 2024-03-27 11:27:34 -04:00
Rangi42 b6039870e5 Remove now-redundant MmappedContent struct 2024-03-27 11:27:34 -04:00
Rangi42 78801e324c Group pointer and size as a ContentSpan struct 2024-03-27 11:27:34 -04:00
Rangi42 bf0cabb3ea Use std::shared_ptr for lexer capture buffers 2024-03-27 11:27:34 -04:00
Rangi42 32db0a0f18 Rename CaptureBody to Capture, and refactor its methods 2024-03-26 12:29:59 -04:00
Rangi42 a167d23d01 Use content-specific destructors for lexer state
Also rename `LexerState` content structs from `*LexerState` to `*Content`
2024-03-26 12:29:59 -04:00
Rangi42 8b6ae994b1 Use STR and CAT macros for # and ## 2024-03-25 14:22:43 -04:00
Rangi42 2b44672873 Rename a few variables 2024-03-25 14:22:38 -04:00
Rangi42 3568418c5d Remove RGBLINK's unimplemented '-s' "smart linking" placeholder flag 2024-03-25 11:36:23 -04:00
Rangi42 cb59119881 Use automatically-allocated std::string_view for macros 2024-03-25 11:33:17 -04:00
Rangi42 d9e5e57e27 Make CaptureBufs be parser values instead of a single static global 2024-03-23 19:44:54 -04:00
Rangi42 e9e8915725 Refactor to keep lexerState and lexerStateEOL static
Also run `clang-format` on everything
2024-03-23 19:14:46 -04:00
Rangi42 6a5518e0c5 Use RAII to unmap or close the lexer states' files automatically 2024-03-22 14:25:36 -04:00
Rangi42 507439bc25 Refactor macro args to be owned collectively by their fstack contexts 2024-03-22 14:25:36 -04:00
Rangi42 b85c5cde8f Use std::shared_ptr for MacroArgs 2024-03-22 14:25:36 -04:00
Rangi42 de667c8afb Remove unused Visitor template 2024-03-22 03:29:56 -04:00
Rangi42 32b4a6f284 Use "snake_case" consistently in parsers 2024-03-21 11:44:07 -04:00
Rangi42 6560b7819d Add make profile, optimized for callgrind 2024-03-21 11:42:12 -04:00
Rangi42 a862c7b17b Use sed instead of awk to extract Bison version 2024-03-18 15:36:45 -04:00
Rangi42 40db9d5cef Use std::string for lexer state paths 2024-03-18 14:42:05 -04:00
Rangi42 05d79d87f6 Pass std::string references to RPN functions 2024-03-18 14:42:05 -04:00
Rangi42 e96675be03 Pass std::string references to fstack functions 2024-03-18 14:42:05 -04:00
Rangi42 472d1bde06 Pass std::string references to symbol functions 2024-03-18 14:42:05 -04:00
Rangi42 6cabb8c9af Pass std::string references to output functions 2024-03-18 14:42:05 -04:00
Rangi42 7b11c528ef Pass std::string references to section functions 2024-03-18 14:42:05 -04:00
Rangi42 91164ac1b0 Pass std::string references to charmap functions 2024-03-18 14:42:05 -04:00
Rangi42 04899a21cd Pass std::string references to parser semantic functions instead of .c_str() pointers
This also refactors some semantic functions to be more efficient
2024-03-18 14:42:05 -04:00
Rangi42 8f77518406 Use std::string for most intermediate parsed strings
This is a work in progress: its performance is unacceptably slow,
and it is obviously not a complete refactoring:

- The parser's semantic functions are still written for C-style
  strings, taking `.c_str()` pointers instead of `std::string`
  references (and using their methods, `<algorithm>`s, etc).
- Quoted string literals from the lexer still use our `String`
  struct, which wraps around a fixed-size char array.
- Symbol values, macro arguments, and so forth are still pointers
  to C-style strings with unclear ownership semantics (i.e. we
  still have "leaks as a feature").
2024-03-18 14:42:05 -04:00
Rangi42 b76e196c89 Run clang-format on everything 2024-03-18 14:08:57 -04:00
Rangi42 d06376c170 Use std::unordered_map and std::vector for sections
This allows us to control the order in which sections are iterated,
instead of it depending on the internals of `std::map`. (This order
is arbitrary, but should be deterministic regardless.)
2024-03-16 11:51:47 -04:00
Rangi42 cefc4f4aa3 Use std::unordered_map for symbols 2024-03-16 11:19:19 -04:00
Rangi42 a14de10e28 Use std::unordered_map for charmaps 2024-03-16 11:13:14 -04:00