✨ feat(mq-lang): add bytes operations#1744
Merged
Merged
Conversation
band, bor, bnot, pack/unpack, and bytes support for index/rindex/starts_with/ends_with/repeat
Contributor
There was a problem hiding this comment.
Pull request overview
Adds bitwise byte operations (band, bor, bnot), binary pack/unpack with 18 numeric formats, and extends existing index, rindex, starts_with, ends_with, and repeat builtins to operate on Bytes. Type signatures are registered in mq-check, and extensive rstest-based unit tests are added.
Changes:
- New
eval/builtin/bytes.rsmodule definingPackFormatpluspack_number/unpack_byteshelpers with full unit-test coverage. - New
band/bor/bnot/pack/unpackbuiltins inbuiltin.rs, plus bytes branches added toindex,rindex,starts_with,ends_with, andrepeat; documentation strings updated. - Type-inference signatures for the new bytes operations registered in
mq-check/src/builtin.rs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/mq-lang/src/eval/builtin/bytes.rs | New PackFormat enum and pack/unpack implementation with extensive tests. |
| crates/mq-lang/src/eval/builtin.rs | Registers new builtins, extends existing ones for Bytes, updates docs, adds tests. |
| crates/mq-check/src/builtin.rs | Registers type signatures for the new bytes-related builtins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
band, bor, bnot, pack/unpack, and bytes support for index/rindex/starts_with/ends_with/repeat