mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 08:55:04 +01:00
printing!!!
This commit is contained in:
parent
27a4ecc46b
commit
761f78de0b
6 changed files with 165 additions and 26 deletions
|
|
@ -136,7 +136,13 @@ function printString(s: string, f: Formatter) {
|
|||
}
|
||||
|
||||
function printBinaryString(buf: Uint8Array, f: Formatter) {
|
||||
f.word(`"${buf.toString()}"`);
|
||||
const parts: string[] = [];
|
||||
for (let i = 0; i < buf.length; i++) {
|
||||
const idx = buf[i];
|
||||
parts.push(`\\${idx.toString(16).padStart(2, "0")}`);
|
||||
}
|
||||
|
||||
f.word(`"${parts.join("")}"`);
|
||||
}
|
||||
|
||||
function printId(id: string | undefined, f: Formatter) {
|
||||
|
|
@ -200,12 +206,12 @@ function printBlockType(type: Blocktype, f: Formatter) {
|
|||
}
|
||||
|
||||
function printMemarg(arg: MemArg, f: Formatter) {
|
||||
if (arg.offset /*0->false*/) {
|
||||
f.word(`offset=${arg.offset}`);
|
||||
}
|
||||
if (arg.align !== undefined) {
|
||||
f.word(`align=${arg.align}`);
|
||||
}
|
||||
if (arg.offset /*0->false*/) {
|
||||
`offset=${arg.offset}`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue