Support for non-consecutive ranges #13

Merged
HEL merged 2 commits from rajayonin/rivet-typst:non-consecutive-ranges into dev 2025-10-21 06:02:04 +00:00
Contributor

Previously, if you had some code like this:

#schema.render(
  schema.load(
    (
      structures: (
        main: (
          bits: 16,
          ranges: (
            "3": (name: "MIE"),
            "7": (name: "MPIE"),
            "12-11": (name: "MPP"),
          ),
        ),
      ),
    ),
  ),
)

it wouldn't render the ending line of the range:
bad

The change I made was to check if this line needed to be painted, and painting it, resulting in:
good

Previously, if you had some code like this: ```typst #schema.render( schema.load( ( structures: ( main: ( bits: 16, ranges: ( "3": (name: "MIE"), "7": (name: "MPIE"), "12-11": (name: "MPP"), ), ), ), ), ), ) ``` it wouldn't render the ending line of the range: ![bad](/attachments/6280f6e4-7c9f-4ffa-92c2-e517853ec63c) The change I made was to check if this line needed to be painted, and painting it, resulting in: ![good](/attachments/7da0636a-b552-4b92-8b22-1a87261b4127)
rajayonin added 1 commit 2025-10-20 16:07:46 +00:00
Paints the start/end line of a range if there was no previous range.
rajayonin added 1 commit 2025-10-20 17:07:08 +00:00
Author
Contributor

We also ensure the first and last bits are set when using non-consecutive ranges w/ all-bit-i:
good

We also ensure the first and last bits are set when using non-consecutive ranges w/ `all-bit-i`: ![good](/attachments/c455ffa9-bb03-4ce2-a27c-2375e96ca337)
5.8 KiB
HEL added the
enhancement
label 2025-10-21 05:53:38 +00:00
HEL approved these changes 2025-10-21 06:01:42 +00:00
HEL left a comment
Owner

Looks good to me 👍
Thank you for your contribution, it is really appreciated

Looks good to me 👍 Thank you for your contribution, it is really appreciated
HEL merged commit 1dd66fd587 into dev 2025-10-21 06:02:04 +00:00
Author
Contributor

@HEL, when are you planning on releasing the next version of the package?

@HEL, when are you planning on releasing the next version of the package?
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/rivet-typst#13
No description provided.