cli: add safe UTF-8 and supplied-buffer hex/base64 std modules

This commit is contained in:
dev committed 2026-10-06 17:06:39 +03:00
1 parent 6397a317e2
commit 3bb11e03b2
42 files changed
+2807 -14

No files matched your search

@@ -0,0 +1,31 @@
; expect: run
; result: [90,103,61,61]
; phase: 1
; spec: docs/spec/16-standard-library.md §2.6.2; docs/spec/07a-air-instructions.md
; Independent RFC 4648 vector: encoding byte 102 produces ASCII Zg==.
module test.text_encode
air 0
lang 0.1
features [arrays, ownership]
fn @main() -> array<u8, 4>
effects []
entry:
%storage = local.alloc array<u8, 4>
%pad = const.u8 61
%initial = array.splat array<u8, 4> %pad
local.store %storage, %initial
%m = borrow.mut %storage
%zero = const.usize 0
%one = const.usize 1
%a = const.u8 90
%b = const.u8 103
%e0 = borrow.index %m, %zero
store %e0, %a
borrow.end %e0
%e1 = borrow.index %m, %one
store %e1, %b
borrow.end %e1
borrow.end %m
%result = local.load %storage
ret %result