@fraczak/k 6.8.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/CLAUDE.md +1 -1
- package/DOCS/BIG_PICTURE.md +3 -5
- package/DOCS/CODECS.md +80 -181
- package/DOCS/CODEC_ARCHITECTURE.md +194 -0
- package/DOCS/REPL.md +69 -51
- package/Examples/arithmetics.k +1 -0
- package/Examples/poly.k +46 -0
- package/backends/llvm/runtime/krt.c +4 -0
- package/backends/llvm/src/kvm2llvm.mjs +2 -2
- package/backends/llvm/tests/test-llvm.mjs +19 -0
- package/backends/wasm/src/kvm2wasm.mjs +4 -0
- package/backends/wasm/tests/test-wasm.mjs +4 -0
- package/browser/repl-browser.mjs +131 -779
- package/browser/shims/process.mjs +7 -0
- package/browser/tree-view.mjs +5 -2
- package/browser/vfs-data.mjs +14 -14
- package/codecs/README.md +7 -0
- package/codecs/ieee.mjs +50 -75
- package/codecs/int.mjs +83 -62
- package/codecs/json-codec.mjs +5 -77
- package/codecs/json.mjs +12 -56
- package/codecs/k-parse.mjs +3 -19
- package/codecs/runtime/codec-sdk.mjs +94 -0
- package/codecs/runtime/pattern-k.mjs +45 -0
- package/codecs/string-codec.mjs +48 -74
- package/codecs/unit.mjs +13 -61
- package/codecs/utf16.mjs +13 -56
- package/codecs/utf8.mjs +11 -55
- package/package.json +1 -1
- package/patterns/from-k.mjs +2 -22
- package/repl-codecs.mjs +69 -196
- package/repl.mjs +177 -281
- package/scripts/build-repl-html.mjs +114 -385
- package/scripts/run-tests.mjs +1 -0
- package/tests/test-codecs.mjs +186 -0
- package/tests/test-poly.mjs +44 -0
- package/tests/test-repl-html.mjs +163 -68
- package/tests/test-repl.mjs +210 -156
- package/tests/test-structural-values.mjs +17 -0
- package/tests/test-tree-view.mjs +3 -0
- package/codecs/example-pipeline.mjs +0 -163
- package/codecs/runtime/ieee-pattern.mjs +0 -30
- package/codecs/runtime/test-codec.mjs +0 -89
- package/codecs/runtime/typeFromValue.mjs +0 -34
|
@@ -17,6 +17,12 @@ export const stdout = {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export const stderr = {
|
|
21
|
+
write(chunk) {
|
|
22
|
+
console.error(chunk);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
20
26
|
export const hrtime = function() {
|
|
21
27
|
const now = performance.now();
|
|
22
28
|
const sec = Math.floor(now / 1000);
|
|
@@ -33,6 +39,7 @@ export const processShim = {
|
|
|
33
39
|
exit,
|
|
34
40
|
stdin,
|
|
35
41
|
stdout,
|
|
42
|
+
stderr,
|
|
36
43
|
hrtime,
|
|
37
44
|
versions: { wabt_browser: "1.0" }
|
|
38
45
|
};
|
package/browser/tree-view.mjs
CHANGED
|
@@ -482,7 +482,7 @@ export function createOutputEntryElement({
|
|
|
482
482
|
// Value Section
|
|
483
483
|
const valSection = document.createElement("details");
|
|
484
484
|
valSection.className = "k-tree-section k-tree-value-section";
|
|
485
|
-
valSection.open =
|
|
485
|
+
valSection.open = false;
|
|
486
486
|
|
|
487
487
|
const valSummary = document.createElement("summary");
|
|
488
488
|
valSummary.className = "k-tree-section-summary";
|
|
@@ -500,7 +500,7 @@ export function createOutputEntryElement({
|
|
|
500
500
|
if (value && value.pattern) {
|
|
501
501
|
const patSection = document.createElement("details");
|
|
502
502
|
patSection.className = "k-tree-section k-tree-pat-section";
|
|
503
|
-
patSection.open =
|
|
503
|
+
patSection.open = false;
|
|
504
504
|
|
|
505
505
|
const patSummary = document.createElement("summary");
|
|
506
506
|
patSummary.className = "k-tree-section-summary";
|
|
@@ -587,6 +587,9 @@ export function createOutputEntryElement({
|
|
|
587
587
|
};
|
|
588
588
|
|
|
589
589
|
collapseAllBtn.onclick = () => {
|
|
590
|
+
valSection.open = false;
|
|
591
|
+
const patSec = treeWrapper.querySelector(".k-tree-pat-section");
|
|
592
|
+
if (patSec) patSec.open = false;
|
|
590
593
|
valBody.innerHTML = "";
|
|
591
594
|
valBody.appendChild(renderValueNode(value, 1, 3));
|
|
592
595
|
if (value && value.pattern && patBody) {
|