Skip to content

Add non-advancing ULEB128 and SLEB128 peeks #763

Closed

Description

@LunaStev

Motivation

Variable-length integer readers always consume input on success. Callers inspecting a tagged/length-prefixed header need non-advancing ULEB128/SLEB128 peeks. #717 covers fixed-width integer peeks only.

Starting points: std/bytes/leb128.wave, std/bytes/cursor.wave.

Scope

Use a reader snapshot or equivalent to expose u64 ULEB128 and i64 SLEB128 peeks. Reuse existing decoding and error policy rather than adding a second codec.

Difficulty: easy.

Completion criteria

  • Preserve the original position on both success and failure.
  • Preserve output on EOF, overflow and invalid input.
  • Keep existing acceptance of noncanonical encodings unchanged.
  • Cover nonzero positions, boundaries and null outputs at O0/O2.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Sep 25, 2026
  2. added a commit that references this issue on Oct 21, 2026
    86f8525
  3. added a commit that references this issue on Oct 21, 2026
    42b65e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions