From d8da21a406f449d277c42b91d4c9bf8b20bd0dcc Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 07:55:08 +0000 Subject: embed: tests, editor support and docs; js vm file access; test fixes embed declarations get accept and reject fixtures, a run-only image check through zc0, an lsp keyword hover and the grammar keyword. errors point at the declaration and still declare the name, so its uses are not reported again. zc0 tracks byte-string globals and lays embedded arrays out one word per element, the way its own indexing reads them. the command-line javascript vm reaches node's file system for the file syscalls, so include and embed work there; other embedders opt in. the web build is self-contained in build/web with its examples. README, BORROW and BOOTSTRAP-OWNERSHIP describe the new build and ownership rules, and ONBOARD.md is a reading and verification order for the code. the suite passes the map header to mklayout, the wasm fuzz program uses the include format, and lsp drivers scale their deadlines on hosts without the arm64 jit (ZC_TEST_TIMEOUT_SCALE). LLVM_CONFIG selects an llvm with headers for the llvm section. --- src/web/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/web') diff --git a/src/web/index.html b/src/web/index.html index 4cf7476..fbc203d 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -41,7 +41,7 @@ let machine = null; for (const n of examples) { const o = document.createElement('option'); o.value = n; o.textContent = n + '.zc'; $('ex').appendChild(o); } $('ex').onchange = async () => { - try { $('src').value = await (await fetch('../examples/' + $('ex').value + '.zc')).text(); } + try { $('src').value = await (await fetch('examples/' + $('ex').value + '.zc')).text(); } catch (e) { $('out').textContent = 'the examples folder is not served next to this page'; } }; $('run').onclick = async () => { @@ -55,6 +55,6 @@ } catch (e) { $('out').textContent = String(e); $('status').textContent = 'failed'; } }; ZC.load('zc.wasm').then(m => { machine = m; $('status').textContent = 'ready'; }) - .catch(e => { $('status').textContent = 'could not load zc.wasm; run src/web/build.sh and serve this folder over http'; }); + .catch(e => { $('status').textContent = 'could not load zc.wasm; run make web and serve build/web over http'; }); -- cgit v1.2.3