Skip to content

Add a bounds-checked binary cursor - #56

Open
relh wants to merge 1 commit into
treeform:masterfrom
relh:relh/binary-cursor
Open

Add a bounds-checked binary cursor#56
relh wants to merge 1 commit into
treeform:masterfrom
relh:relh/binary-cursor

Conversation

@relh

@relh relh commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • add a small stateful cursor for sequential in-memory binary parsing
  • expose catchable bounds errors, bounded slices and C strings, seeking, alignment, and subcursors
  • provide explicit little- and big-endian integer and floating-point reads

This complements flatty/binny: fixed-offset reads remain in binny, while parsers that consume fields in sequence no longer need to duplicate cursor and bounds bookkeeping. The module is dependency-free beyond Flatty itself and contains no format-specific policy.

Validation

  • nim check src/flatty/cursor.nim
  • nim r tests/tests.nim
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant