update examples after making hs2js sync

This commit is contained in:
Felix Roos 2024-05-17 20:51:43 +02:00
parent d132344d11
commit 71f8c0745c
2 changed files with 11 additions and 6 deletions

View file

@ -1,10 +1,12 @@
import { run, parse } from 'hs2js';
import { run, parse, loadParser } from 'hs2js';
import { initStrudel, reify, late, samples, stack } from '@strudel/web';
initStrudel({
prebake: () => samples('github:tidalcycles/dirt-samples'),
});
const ready = loadParser();
const textarea = document.getElementById('code');
if (window.location.hash) {
textarea.value = atob(window.location.hash.slice(1));
@ -50,8 +52,9 @@ const ops = getInfixOperators();
async function update() {
let result, tree;
await ready;
try {
tree = await parse(textarea.value);
tree = parse(textarea.value);
} catch (err) {
console.warn('parse error');
console.error(err);