feat: finalize the Hemx 0.4 core
CI / test (push) Has been cancelled

This commit is contained in:
tmk241
2026-09-02 17:28:40 +02:00
parent 1dc9734f16
commit a3c72e21db
15 changed files with 96 additions and 231 deletions
+7 -1
View File
@@ -939,7 +939,13 @@
if (discriminant === 1) return read();
throw new Error(`unknown hemx option ${discriminant}`);
};
const resource = () => ({ kind: enumValue(["slot", "atom", "handle", "form"], "hemx resource"), id: u32() });
const resource = () => {
const kind = u8();
if (kind === 0) return { kind: "slot", id: u32() };
if (kind === 2) return { kind: "handle", id: u32() };
if (kind === 3) return { kind: "form", id: u32() };
throw new Error(`unknown hemx resource ${kind}`);
};
const scope = () => {
const kind = u8();
if (kind === 0) return null;