mondo mode for StrudelMirror / repl / mini repl

This commit is contained in:
Felix Roos 2025-03-23 22:47:33 +01:00
parent 6d21456423
commit 5eabcf0618
No known key found for this signature in database
4 changed files with 11 additions and 2 deletions

View file

@ -21,6 +21,7 @@ export function repl({
setInterval,
clearInterval,
id,
mondo = false,
}) {
const state = {
schedulerError: undefined,
@ -180,6 +181,10 @@ export function repl({
setTime(() => scheduler.now()); // TODO: refactor?
await beforeEval?.({ code });
shouldHush && hush();
if (mondo) {
code = `mondolang\`${code}\``;
}
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions);
if (Object.keys(pPatterns).length) {
let patterns = Object.values(pPatterns);