diff --git a/compile.phi b/compile.phi index 861c37b..cedda74 100644 --- a/compile.phi +++ b/compile.phi @@ -27,9 +27,7 @@ (fn generate () (do (emit "#!/usr/bin/env node\n") (emit "import { Runtime } from \"./runtime.js\";\n") - (emit "const runtime = new Runtime({ filename: \"") - (emit filename) - (emit "\" });\n") + (emit (format "const runtime = new Runtime(\"%\");\n" filename)) (for (ident builtin_id) builtin_syms (do (define_builtin ident builtin_id) diff --git a/runtime.js b/runtime.js index 1dd7c24..b498740 100644 --- a/runtime.js +++ b/runtime.js @@ -2,19 +2,22 @@ import fs from "node:fs"; import process from "node:process"; export class Runtime { - constructor({ filename, args } = {}) { - this.callStack = [{ name: "", line: 0 }]; - this.filename = filename; - this.args = args ?? process.argv.slice(2); + constructor(filename) { + this.callStack = [{ name: "", filename, line: 0 }]; + this.currentFilename = filename; this.currentLine = 0; } + setFile(filename) { + this.currentFilename = filename; + } + setLine(line) { this.currentLine = line; } - pushCall(name, line = this.currentLine) { - this.callStack.push({ name, line }); + pushCall(name, filename = this.filename, line = this.currentLine) { + this.callStack.push({ name, filename, line }); } popCall() { @@ -35,13 +38,13 @@ export class Runtime { const reversedStack = this.callStack.toReversed(); const last = reversedStack[0]; console.error( - ` \x1b[90mat \x1b[37m${last.name} \x1b[90m(${this.filename}:${this.currentLine})\x1b[0m`, + ` \x1b[90mat \x1b[37m${last.name} \x1b[90m(${this.currentFilename}:${this.currentLine})\x1b[0m`, ); for (let i = 0; i < reversedStack.length - 1 && i < 20; ++i) { const name = reversedStack[i + 1].name; - const line = reversedStack[i].line; + const { filename, line } = reversedStack[i]; console.error( - ` \x1b[90mat \x1b[37m${name} \x1b[90m(${this.filename}:${line})\x1b[0m`, + ` \x1b[90mat \x1b[37m${name} \x1b[90m(${filename}:${line})\x1b[0m`, ); } } @@ -219,7 +222,7 @@ export class Runtime { builtinGetArgs() { return { type: "list", - values: this.args + values: process.argv.slice(2) .map((value) => ({ type: "string", value })), }; } diff --git a/stage2.js b/stage2.js index 4fbdf7f..e2912aa 100644 --- a/stage2.js +++ b/stage2.js @@ -1,6 +1,6 @@ #!/usr/bin/env node import { Runtime } from "./runtime.js"; -const runtime = new Runtime({ filename: "compile.phi" }); +const runtime = new Runtime("compile.phi"); function _Emitter14(_ast25, _filename26) { runtime.pushCall("Emitter"); const r_0 = ({ type: "list", values: [] }); @@ -32,20 +32,18 @@ function _generate27() { runtime.pushCall("generate"); (runtime.setLine(28), _emit36(({ type: "string", value: "#!/usr/bin/env node\n" }))); (runtime.setLine(29), _emit36(({ type: "string", value: "import { Runtime } from \"./runtime.js\";\n" }))); -(runtime.setLine(30), _emit36(({ type: "string", value: "const runtime = new Runtime({ filename: \"" }))); -(runtime.setLine(31), _emit36(_filename26)); -(runtime.setLine(32), _emit36(({ type: "string", value: "\" });\n" }))); +(runtime.setLine(30), _emit36((runtime.setLine(30), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "const runtime = new Runtime(\"%\");\n" }), _filename26)))); for (const r_14 of _builtin_syms51.values) {; const r_15 = r_14.values[0] ?? { type: "null"}; let _ident52 = r_15; const r_16 = r_14.values[1] ?? { type: "null"}; let _builtin_id53 = r_16; -(runtime.setLine(35), _define_builtin37(_ident52, _builtin_id53)); +(runtime.setLine(33), _define_builtin37(_ident52, _builtin_id53)); }; -(runtime.setLine(38), _discover_syms29(_ast25)); -(runtime.setLine(39), _emit_exprs28(_ast25)); +(runtime.setLine(36), _discover_syms29(_ast25)); +(runtime.setLine(37), _emit_exprs28(_ast25)); runtime.popCall(); -return (runtime.setLine(40), ((...args) => runtime.builtinStringsJoin(...args))(_output41)); +return (runtime.setLine(38), ((...args) => runtime.builtinStringsJoin(...args))(_output41)); ; runtime.popCall(); return { type: "null" }; @@ -54,8 +52,8 @@ function _emit_exprs28(_exprs54) { runtime.pushCall("emit_exprs"); for (const r_17 of _exprs54.values) {; let _expr55 = r_17; -(runtime.setLine(45), _emit_expr30(_expr55)); -(runtime.setLine(46), _emit36(({ type: "string", value: ";\n" }))); +(runtime.setLine(43), _emit_expr30(_expr55)); +(runtime.setLine(44), _emit36(({ type: "string", value: ";\n" }))); }; ; runtime.popCall(); @@ -78,7 +76,7 @@ const r_23 = r_22.values[0] ?? { type: "null"}; const r_24 = r_22.values[1] ?? { type: "null"}; const r_25 = r_22.values[2] ?? { type: "null"}; let _s60 = r_25; -if (runtime.truthy(runtime.opEq((runtime.setLine(55), ((...args) => runtime.builtinLen(...args))(_s60)), ({ type: "int", value: 0 })))) { +if (runtime.truthy(runtime.opEq((runtime.setLine(53), ((...args) => runtime.builtinLen(...args))(_s60)), ({ type: "int", value: 0 })))) { runtime.popCall(); return { type: "null" }}; const r_26 = _s60; @@ -102,7 +100,7 @@ const r_40 = r_37.values[2] ?? { type: "null"}; let _params63 = r_40; const r_41 = r_31.values[3] ?? { type: "null"}; let _body64 = r_41; -(runtime.setLine(59), _define_fn38(_ident62, _line59)); +(runtime.setLine(57), _define_fn38(_ident62, _line59)); }; }; ; @@ -117,7 +115,7 @@ let _ty66 = r_43; const r_44 = r_42.values[1] ?? { type: "null"}; let _line67 = r_44; if (runtime.truthy(runtime.opEq(_ty66, ({ type: "string", value: "list" })))) { -(runtime.setLine(67), _emit_list31(_expr65)); +(runtime.setLine(65), _emit_list31(_expr65)); } else { if (runtime.truthy(runtime.opEq(_ty66, ({ type: "string", value: "int" })))) { const r_45 = _expr65; @@ -125,7 +123,7 @@ const r_46 = r_45.values[0] ?? { type: "null"}; const r_47 = r_45.values[1] ?? { type: "null"}; const r_48 = r_45.values[2] ?? { type: "null"}; let _value68 = r_48; -(runtime.setLine(70), _emit36((runtime.setLine(70), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "({ type: \"int\", value: % })" }), _value68)))); +(runtime.setLine(68), _emit36((runtime.setLine(68), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "({ type: \"int\", value: % })" }), _value68)))); } else { if (runtime.truthy(runtime.opEq(_ty66, ({ type: "string", value: "string" })))) { const r_49 = _expr65; @@ -133,7 +131,7 @@ const r_50 = r_49.values[0] ?? { type: "null"}; const r_51 = r_49.values[1] ?? { type: "null"}; const r_52 = r_49.values[2] ?? { type: "null"}; let _value69 = r_52; -(runtime.setLine(73), _emit36((runtime.setLine(73), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "({ type: \"string\", value: \"%\" })" }), (runtime.setLine(73), _string_escape17(_value69)))))); +(runtime.setLine(71), _emit36((runtime.setLine(71), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "({ type: \"string\", value: \"%\" })" }), (runtime.setLine(71), _string_escape17(_value69)))))); } else { if (runtime.truthy(runtime.opEq(_ty66, ({ type: "string", value: "ident" })))) { const r_53 = _expr65; @@ -142,24 +140,24 @@ const r_55 = r_53.values[1] ?? { type: "null"}; const r_56 = r_53.values[2] ?? { type: "null"}; let _value70 = r_56; if (runtime.truthy(runtime.opEq(_value70, ({ type: "string", value: "null" })))) { -(runtime.setLine(78), _emit36(({ type: "string", value: "({ type: \"null\" })" }))); +(runtime.setLine(76), _emit36(({ type: "string", value: "({ type: \"null\" })" }))); runtime.popCall(); return { type: "null" }; } else { if (runtime.truthy(runtime.opEq(_value70, ({ type: "string", value: "false" })))) { -(runtime.setLine(81), _emit36(({ type: "string", value: "({ type: \"bool\", value: false })" }))); +(runtime.setLine(79), _emit36(({ type: "string", value: "({ type: \"bool\", value: false })" }))); runtime.popCall(); return { type: "null" }; } else { if (runtime.truthy(runtime.opEq(_value70, ({ type: "string", value: "true" })))) { -(runtime.setLine(84), _emit36(({ type: "string", value: "({ type: \"bool\", value: true })" }))); +(runtime.setLine(82), _emit36(({ type: "string", value: "({ type: \"bool\", value: true })" }))); runtime.popCall(); return { type: "null" }; }}}; -const r_57 = (runtime.setLine(88), _get_sym45(_value70)); +const r_57 = (runtime.setLine(86), _get_sym45(_value70)); let _sym71 = r_57; if (runtime.truthy(runtime.opEq(_sym71, ({ type: "null" })))) { -(runtime.setLine(90), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "undefined symbol '%' on line %" }), _value70, _line67)); +(runtime.setLine(88), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "undefined symbol '%' on line %" }), _value70, _line67)); }; const r_58 = _sym71; const r_59 = r_58.values[0] ?? { type: "null"}; @@ -172,21 +170,21 @@ const r_62 = r_61.values[0] ?? { type: "null"}; const r_63 = r_61.values[1] ?? { type: "null"}; const r_64 = r_61.values[2] ?? { type: "null"}; let _id74 = r_64; -(runtime.setLine(96), _emit36((runtime.setLine(96), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "((...args) => runtime.%(...args))" }), _id74)))); +(runtime.setLine(94), _emit36((runtime.setLine(94), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "((...args) => runtime.%(...args))" }), _id74)))); } else { if (runtime.truthy(runtime.opEq(_sym_ty73, ({ type: "string", value: "fn" })))) { -(runtime.setLine(98), _emit36((runtime.setLine(98), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); +(runtime.setLine(96), _emit36((runtime.setLine(96), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); } else { if (runtime.truthy(runtime.opEq(_sym_ty73, ({ type: "string", value: "param" })))) { -(runtime.setLine(100), _emit36((runtime.setLine(100), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); +(runtime.setLine(98), _emit36((runtime.setLine(98), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); } else { if (runtime.truthy(runtime.opEq(_sym_ty73, ({ type: "string", value: "let" })))) { -(runtime.setLine(102), _emit36((runtime.setLine(102), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); +(runtime.setLine(100), _emit36((runtime.setLine(100), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _value70, _sym_id72)))); } else { -(runtime.setLine(104), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented '%'" }), _sym_ty73)); +(runtime.setLine(102), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented '%'" }), _sym_ty73)); }}}}; } else { -(runtime.setLine(107), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "unknown expr type '%' on line %" }), _ty66, _line67)); +(runtime.setLine(105), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "unknown expr type '%' on line %" }), _ty66, _line67)); }}}}; ; runtime.popCall(); @@ -201,8 +199,8 @@ const r_67 = r_65.values[1] ?? { type: "null"}; let _line77 = r_67; const r_68 = r_65.values[2] ?? { type: "null"}; let _s78 = r_68; -if (runtime.truthy(runtime.opEq((runtime.setLine(113), ((...args) => runtime.builtinLen(...args))(_s78)), ({ type: "int", value: 0 })))) { -(runtime.setLine(114), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "illegal function on line %" }), _line77)); +if (runtime.truthy(runtime.opEq((runtime.setLine(111), ((...args) => runtime.builtinLen(...args))(_s78)), ({ type: "int", value: 0 })))) { +(runtime.setLine(112), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "illegal function on line %" }), _line77)); }; const r_69 = _s78; const r_70 = r_69.values[0] ?? { type: "null"}; @@ -212,7 +210,7 @@ const r_72 = r_70.values[1] ?? { type: "null"}; const r_73 = r_70.values[2] ?? { type: "null"}; let _id80 = r_73; if (runtime.truthy(runtime.opNe(_id_ty79, ({ type: "string", value: "ident" })))) { -(runtime.setLine(118), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "illegal function on line %" }), _line77)); +(runtime.setLine(116), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "illegal function on line %" }), _line77)); }; if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "fn" })))) { const r_74 = _s78; @@ -229,13 +227,13 @@ const r_83 = r_80.values[2] ?? { type: "null"}; let _params82 = r_83; const r_84 = r_74.values[3] ?? { type: "null"}; let _body83 = r_84; -const r_85 = (runtime.setLine(123), _get_sym45(_ident81)); +const r_85 = (runtime.setLine(121), _get_sym45(_ident81)); let _sym84 = r_85; const r_86 = _sym84; const r_87 = r_86.values[0] ?? { type: "null"}; let _sym_id85 = r_87; -(runtime.setLine(126), _emit36((runtime.setLine(126), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "function _%%(" }), _ident81, _sym_id85)))); -(runtime.setLine(128), _enter_scope42()); +(runtime.setLine(124), _emit36((runtime.setLine(124), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "function _%%(" }), _ident81, _sym_id85)))); +(runtime.setLine(126), _enter_scope42()); const r_88 = ({ type: "bool", value: true }); let _first86 = r_88; for (const r_89 of _params82.values) {; @@ -244,18 +242,18 @@ const r_91 = r_89.values[1] ?? { type: "null"}; const r_92 = r_89.values[2] ?? { type: "null"}; let _ident87 = r_92; if (runtime.truthy(runtime.opNot(_first86))) { -(runtime.setLine(133), _emit36(({ type: "string", value: ", " }))); +(runtime.setLine(131), _emit36(({ type: "string", value: ", " }))); }; (_first86 = ({ type: "bool", value: false })); -const r_93 = (runtime.setLine(137), _define_param39(_ident87, _line77)); +const r_93 = (runtime.setLine(135), _define_param39(_ident87, _line77)); let _sym_id88 = r_93; -(runtime.setLine(138), _emit36((runtime.setLine(138), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _ident87, _sym_id88)))); +(runtime.setLine(136), _emit36((runtime.setLine(136), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "_%%" }), _ident87, _sym_id88)))); }; -(runtime.setLine(142), _emit36(({ type: "string", value: ") {\n" }))); -(runtime.setLine(143), _emit36((runtime.setLine(143), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.pushCall(\"%\");\n" }), _ident81)))); -(runtime.setLine(145), _emit_expr30(_body83)); -(runtime.setLine(146), _emit36(({ type: "string", value: ";\nruntime.popCall();\nreturn { type: \"null\" };\n}" }))); -(runtime.setLine(148), _leave_scope43()); +(runtime.setLine(140), _emit36(({ type: "string", value: ") {\n" }))); +(runtime.setLine(141), _emit36((runtime.setLine(141), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.pushCall(\"%\");\n" }), _ident81)))); +(runtime.setLine(143), _emit_expr30(_body83)); +(runtime.setLine(144), _emit36(({ type: "string", value: ";\nruntime.popCall();\nreturn { type: \"null\" };\n}" }))); +(runtime.setLine(146), _leave_scope43()); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "let" })))) { const r_94 = _s78; @@ -264,18 +262,18 @@ const r_96 = r_94.values[1] ?? { type: "null"}; let _pat89 = r_96; const r_97 = r_94.values[2] ?? { type: "null"}; let _expr90 = r_97; -const r_98 = (runtime.setLine(151), _let_node_reg_count47()); +const r_98 = (runtime.setLine(149), _let_node_reg_count47()); let _reg91 = r_98; -(runtime.setLine(152), _let_node_reg_increment48()); -(runtime.setLine(153), _emit36((runtime.setLine(153), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "const r_% = " }), _reg91)))); -(runtime.setLine(154), _emit_expr30(_expr90)); -(runtime.setLine(155), _emit_let_node33(_pat89, _reg91)); +(runtime.setLine(150), _let_node_reg_increment48()); +(runtime.setLine(151), _emit36((runtime.setLine(151), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "const r_% = " }), _reg91)))); +(runtime.setLine(152), _emit_expr30(_expr90)); +(runtime.setLine(153), _emit_let_node33(_pat89, _reg91)); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "do" })))) { -(runtime.setLine(157), _enter_scope42()); -(runtime.setLine(158), _discover_syms29((runtime.setLine(158), _slice24(_s78, ({ type: "int", value: 1 }))))); -(runtime.setLine(159), _emit_exprs28((runtime.setLine(159), _slice24(_s78, ({ type: "int", value: 1 }))))); -(runtime.setLine(160), _leave_scope43()); +(runtime.setLine(155), _enter_scope42()); +(runtime.setLine(156), _discover_syms29((runtime.setLine(156), _slice24(_s78, ({ type: "int", value: 1 }))))); +(runtime.setLine(157), _emit_exprs28((runtime.setLine(157), _slice24(_s78, ({ type: "int", value: 1 }))))); +(runtime.setLine(158), _leave_scope43()); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "for" })))) { const r_99 = _s78; @@ -286,29 +284,29 @@ const r_102 = r_99.values[2] ?? { type: "null"}; let _expr93 = r_102; const r_103 = r_99.values[3] ?? { type: "null"}; let _body94 = r_103; -const r_104 = (runtime.setLine(164), _let_node_reg_count47()); +const r_104 = (runtime.setLine(162), _let_node_reg_count47()); let _reg95 = r_104; -(runtime.setLine(165), _let_node_reg_increment48()); -(runtime.setLine(166), _emit36((runtime.setLine(166), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "for (const r_% of " }), _reg95)))); -(runtime.setLine(167), _emit_expr30(_expr93)); -(runtime.setLine(168), _emit36(({ type: "string", value: ".values) {" }))); +(runtime.setLine(163), _let_node_reg_increment48()); +(runtime.setLine(164), _emit36((runtime.setLine(164), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "for (const r_% of " }), _reg95)))); +(runtime.setLine(165), _emit_expr30(_expr93)); +(runtime.setLine(166), _emit36(({ type: "string", value: ".values) {" }))); +(runtime.setLine(168), _enter_scope42()); +(runtime.setLine(169), _emit_let_node33(_pat92, _reg95)); (runtime.setLine(170), _enter_scope42()); -(runtime.setLine(171), _emit_let_node33(_pat92, _reg95)); -(runtime.setLine(172), _enter_scope42()); -(runtime.setLine(174), _emit36(({ type: "string", value: ";\n" }))); -(runtime.setLine(175), _emit_expr30(_body94)); -(runtime.setLine(176), _emit36(({ type: "string", value: "}" }))); -(runtime.setLine(178), _leave_scope43()); -(runtime.setLine(179), _leave_scope43()); +(runtime.setLine(172), _emit36(({ type: "string", value: ";\n" }))); +(runtime.setLine(173), _emit_expr30(_body94)); +(runtime.setLine(174), _emit36(({ type: "string", value: "}" }))); +(runtime.setLine(176), _leave_scope43()); +(runtime.setLine(177), _leave_scope43()); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "loop" })))) { const r_105 = _s78; const r_106 = r_105.values[0] ?? { type: "null"}; const r_107 = r_105.values[1] ?? { type: "null"}; let _body96 = r_107; -(runtime.setLine(182), _emit36(({ type: "string", value: "while (true) {\n" }))); -(runtime.setLine(183), _emit_expr30(_body96)); -(runtime.setLine(184), _emit36(({ type: "string", value: "}" }))); +(runtime.setLine(180), _emit36(({ type: "string", value: "while (true) {\n" }))); +(runtime.setLine(181), _emit_expr30(_body96)); +(runtime.setLine(182), _emit36(({ type: "string", value: "}" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "if" })))) { const r_108 = _s78; @@ -319,15 +317,15 @@ const r_111 = r_108.values[2] ?? { type: "null"}; let _truthy98 = r_111; const r_112 = r_108.values[3] ?? { type: "null"}; let _falsy99 = r_112; -(runtime.setLine(187), _emit36(({ type: "string", value: "if (runtime.truthy(" }))); -(runtime.setLine(188), _emit_expr30(_cond97)); -(runtime.setLine(189), _emit36(({ type: "string", value: ")) {\n" }))); -(runtime.setLine(190), _emit_expr30(_truthy98)); -(runtime.setLine(191), _emit36(({ type: "string", value: "}" }))); +(runtime.setLine(185), _emit36(({ type: "string", value: "if (runtime.truthy(" }))); +(runtime.setLine(186), _emit_expr30(_cond97)); +(runtime.setLine(187), _emit36(({ type: "string", value: ")) {\n" }))); +(runtime.setLine(188), _emit_expr30(_truthy98)); +(runtime.setLine(189), _emit36(({ type: "string", value: "}" }))); if (runtime.truthy(runtime.opNe(_falsy99, ({ type: "null" })))) { -(runtime.setLine(193), _emit36(({ type: "string", value: " else {\n" }))); -(runtime.setLine(194), _emit_expr30(_falsy99)); -(runtime.setLine(195), _emit36(({ type: "string", value: "}" }))); +(runtime.setLine(191), _emit36(({ type: "string", value: " else {\n" }))); +(runtime.setLine(192), _emit_expr30(_falsy99)); +(runtime.setLine(193), _emit36(({ type: "string", value: "}" }))); }; } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "return" })))) { @@ -335,12 +333,12 @@ const r_113 = _s78; const r_114 = r_113.values[0] ?? { type: "null"}; const r_115 = r_113.values[1] ?? { type: "null"}; let _value100 = r_115; -(runtime.setLine(199), _emit36(({ type: "string", value: "runtime.popCall();\n" }))); -(runtime.setLine(200), _emit36(({ type: "string", value: "return " }))); +(runtime.setLine(197), _emit36(({ type: "string", value: "runtime.popCall();\n" }))); +(runtime.setLine(198), _emit36(({ type: "string", value: "return " }))); if (runtime.truthy(runtime.opNe(_value100, ({ type: "null" })))) { -(runtime.setLine(202), _emit_expr30(_value100)); +(runtime.setLine(200), _emit_expr30(_value100)); } else { -(runtime.setLine(204), _emit36(({ type: "string", value: "{ type: \"null\" }" }))); +(runtime.setLine(202), _emit36(({ type: "string", value: "{ type: \"null\" }" }))); }; } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "break" })))) { @@ -348,9 +346,9 @@ const r_116 = _s78; const r_117 = r_116.values[0] ?? { type: "null"}; const r_118 = r_116.values[1] ?? { type: "null"}; let _value101 = r_118; -(runtime.setLine(208), _emit36(({ type: "string", value: "break" }))); +(runtime.setLine(206), _emit36(({ type: "string", value: "break" }))); if (runtime.truthy(runtime.opNe(_value101, ({ type: "null" })))) { -(runtime.setLine(210), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented" }))); +(runtime.setLine(208), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented" }))); }; } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "call" })))) { @@ -358,34 +356,34 @@ const r_119 = _s78; const r_120 = r_119.values[0] ?? { type: "null"}; const r_121 = r_119.values[1] ?? { type: "null"}; let _callee102 = r_121; -const r_122 = (runtime.setLine(214), _slice24(_s78, ({ type: "int", value: 2 }))); +const r_122 = (runtime.setLine(212), _slice24(_s78, ({ type: "int", value: 2 }))); let _args103 = r_122; -(runtime.setLine(215), _emit36((runtime.setLine(215), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%), " }), _line77)))); -(runtime.setLine(216), _emit_expr30(_callee102)); -(runtime.setLine(217), _emit36(({ type: "string", value: "(" }))); +(runtime.setLine(213), _emit36((runtime.setLine(213), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%), " }), _line77)))); +(runtime.setLine(214), _emit_expr30(_callee102)); +(runtime.setLine(215), _emit36(({ type: "string", value: "(" }))); const r_123 = ({ type: "bool", value: true }); let _first104 = r_123; for (const r_124 of _args103.values) {; let _arg105 = r_124; if (runtime.truthy(runtime.opNot(_first104))) { -(runtime.setLine(222), _emit36(({ type: "string", value: ", " }))); +(runtime.setLine(220), _emit36(({ type: "string", value: ", " }))); }; (_first104 = ({ type: "bool", value: false })); -(runtime.setLine(226), _emit_expr30(_arg105)); +(runtime.setLine(224), _emit_expr30(_arg105)); }; -(runtime.setLine(229), _emit36(({ type: "string", value: "))" }))); +(runtime.setLine(227), _emit36(({ type: "string", value: "))" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "list" })))) { -(runtime.setLine(231), _emit_list_literal32((runtime.setLine(231), _slice24(_s78, ({ type: "int", value: 1 }))))); +(runtime.setLine(229), _emit_list_literal32((runtime.setLine(229), _slice24(_s78, ({ type: "int", value: 1 }))))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "=" })))) { -(runtime.setLine(233), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "=" }))); +(runtime.setLine(231), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "=" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "+=" })))) { -(runtime.setLine(235), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "+" }))); +(runtime.setLine(233), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "+" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "-=" })))) { -(runtime.setLine(237), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "-" }))); +(runtime.setLine(235), _emit_assign_expr35(_s78, _line77, ({ type: "string", value: "-" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "or" })))) { const r_125 = _s78; @@ -394,12 +392,12 @@ const r_127 = r_125.values[1] ?? { type: "null"}; let _left106 = r_127; const r_128 = r_125.values[2] ?? { type: "null"}; let _right107 = r_128; -(runtime.setLine(240), _emit36((runtime.setLine(240), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%)" }), _line77)))); -(runtime.setLine(241), _emit36(({ type: "string", value: ", { type: \"bool\", value: runtime.truthy(" }))); -(runtime.setLine(242), _emit_expr30(_left106)); -(runtime.setLine(243), _emit36(({ type: "string", value: ") || runtime.truthy(" }))); -(runtime.setLine(244), _emit_expr30(_right107)); -(runtime.setLine(245), _emit36(({ type: "string", value: ") })" }))); +(runtime.setLine(238), _emit36((runtime.setLine(238), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%)" }), _line77)))); +(runtime.setLine(239), _emit36(({ type: "string", value: ", { type: \"bool\", value: runtime.truthy(" }))); +(runtime.setLine(240), _emit_expr30(_left106)); +(runtime.setLine(241), _emit36(({ type: "string", value: ") || runtime.truthy(" }))); +(runtime.setLine(242), _emit_expr30(_right107)); +(runtime.setLine(243), _emit36(({ type: "string", value: ") })" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "and" })))) { const r_129 = _s78; @@ -408,65 +406,65 @@ const r_131 = r_129.values[1] ?? { type: "null"}; let _left108 = r_131; const r_132 = r_129.values[2] ?? { type: "null"}; let _right109 = r_132; -(runtime.setLine(248), _emit36((runtime.setLine(248), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%)" }), _line77)))); -(runtime.setLine(249), _emit36(({ type: "string", value: ", { type: \"bool\", value: runtime.truthy(" }))); -(runtime.setLine(250), _emit_expr30(_left108)); -(runtime.setLine(251), _emit36(({ type: "string", value: ") && runtime.truthy(" }))); -(runtime.setLine(252), _emit_expr30(_right109)); -(runtime.setLine(253), _emit36(({ type: "string", value: ") })" }))); +(runtime.setLine(246), _emit36((runtime.setLine(246), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%)" }), _line77)))); +(runtime.setLine(247), _emit36(({ type: "string", value: ", { type: \"bool\", value: runtime.truthy(" }))); +(runtime.setLine(248), _emit_expr30(_left108)); +(runtime.setLine(249), _emit36(({ type: "string", value: ") && runtime.truthy(" }))); +(runtime.setLine(250), _emit_expr30(_right109)); +(runtime.setLine(251), _emit36(({ type: "string", value: ") })" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "==" })))) { -(runtime.setLine(255), _emit_binary_op34(_s78, ({ type: "string", value: "opEq" }))); +(runtime.setLine(253), _emit_binary_op34(_s78, ({ type: "string", value: "opEq" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "!=" })))) { -(runtime.setLine(257), _emit_binary_op34(_s78, ({ type: "string", value: "opNe" }))); +(runtime.setLine(255), _emit_binary_op34(_s78, ({ type: "string", value: "opNe" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "<" })))) { -(runtime.setLine(259), _emit_binary_op34(_s78, ({ type: "string", value: "opLt" }))); +(runtime.setLine(257), _emit_binary_op34(_s78, ({ type: "string", value: "opLt" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: ">" })))) { -(runtime.setLine(261), _emit_binary_op34(_s78, ({ type: "string", value: "opGt" }))); +(runtime.setLine(259), _emit_binary_op34(_s78, ({ type: "string", value: "opGt" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "<=" })))) { -(runtime.setLine(263), _emit_binary_op34(_s78, ({ type: "string", value: "opLte" }))); +(runtime.setLine(261), _emit_binary_op34(_s78, ({ type: "string", value: "opLte" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: ">=" })))) { -(runtime.setLine(265), _emit_binary_op34(_s78, ({ type: "string", value: "opGte" }))); +(runtime.setLine(263), _emit_binary_op34(_s78, ({ type: "string", value: "opGte" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "+" })))) { -(runtime.setLine(267), _emit_binary_op34(_s78, ({ type: "string", value: "opAdd" }))); +(runtime.setLine(265), _emit_binary_op34(_s78, ({ type: "string", value: "opAdd" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "-" })))) { -(runtime.setLine(269), _emit_binary_op34(_s78, ({ type: "string", value: "opSub" }))); +(runtime.setLine(267), _emit_binary_op34(_s78, ({ type: "string", value: "opSub" }))); } else { if (runtime.truthy(runtime.opEq(_id80, ({ type: "string", value: "not" })))) { const r_133 = _s78; const r_134 = r_133.values[0] ?? { type: "null"}; const r_135 = r_133.values[1] ?? { type: "null"}; let _expr110 = r_135; -(runtime.setLine(272), _emit36(({ type: "string", value: "runtime.opNot(" }))); -(runtime.setLine(273), _emit_expr30(_expr110)); -(runtime.setLine(274), _emit36(({ type: "string", value: ")" }))); +(runtime.setLine(270), _emit36(({ type: "string", value: "runtime.opNot(" }))); +(runtime.setLine(271), _emit_expr30(_expr110)); +(runtime.setLine(272), _emit36(({ type: "string", value: ")" }))); } else { const r_136 = _s78; const r_137 = r_136.values[0] ?? { type: "null"}; let _callee111 = r_137; -const r_138 = (runtime.setLine(277), _slice24(_s78, ({ type: "int", value: 1 }))); +const r_138 = (runtime.setLine(275), _slice24(_s78, ({ type: "int", value: 1 }))); let _args112 = r_138; -(runtime.setLine(278), _emit36((runtime.setLine(278), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%), " }), _line77)))); -(runtime.setLine(279), _emit_expr30(_callee111)); -(runtime.setLine(280), _emit36(({ type: "string", value: "(" }))); +(runtime.setLine(276), _emit36((runtime.setLine(276), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(runtime.setLine(%), " }), _line77)))); +(runtime.setLine(277), _emit_expr30(_callee111)); +(runtime.setLine(278), _emit36(({ type: "string", value: "(" }))); const r_139 = ({ type: "bool", value: true }); let _first113 = r_139; for (const r_140 of _args112.values) {; let _arg114 = r_140; if (runtime.truthy(runtime.opNot(_first113))) { -(runtime.setLine(285), _emit36(({ type: "string", value: ", " }))); +(runtime.setLine(283), _emit36(({ type: "string", value: ", " }))); }; (_first113 = ({ type: "bool", value: false })); -(runtime.setLine(289), _emit_expr30(_arg114)); +(runtime.setLine(287), _emit_expr30(_arg114)); }; -(runtime.setLine(292), _emit36(({ type: "string", value: "))" }))); +(runtime.setLine(290), _emit36(({ type: "string", value: "))" }))); }}}}}}}}}}}}}}}}}}}}}}}}; ; runtime.popCall(); @@ -474,18 +472,18 @@ return { type: "null" }; }; function _emit_list_literal32(_s115) { runtime.pushCall("emit_list_literal"); -(runtime.setLine(297), _emit36(({ type: "string", value: "({ type: \"list\", values: [" }))); +(runtime.setLine(295), _emit36(({ type: "string", value: "({ type: \"list\", values: [" }))); const r_141 = ({ type: "bool", value: true }); let _first116 = r_141; for (const r_142 of _s115.values) {; let _e117 = r_142; if (runtime.truthy(runtime.opNot(_first116))) { -(runtime.setLine(301), _emit36(({ type: "string", value: ", " }))); +(runtime.setLine(299), _emit36(({ type: "string", value: ", " }))); }; (_first116 = ({ type: "bool", value: false })); -(runtime.setLine(305), _emit_expr30(_e117)); +(runtime.setLine(303), _emit_expr30(_e117)); }; -(runtime.setLine(307), _emit36(({ type: "string", value: "] })" }))); +(runtime.setLine(305), _emit36(({ type: "string", value: "] })" }))); ; runtime.popCall(); return { type: "null" }; @@ -506,9 +504,9 @@ let _ident122 = r_149; if (runtime.truthy(runtime.opEq(_ident122, ({ type: "string", value: "_" })))) { runtime.popCall(); return { type: "null" }}; -const r_150 = (runtime.setLine(317), _define_let40(_ident122, _line121)); +const r_150 = (runtime.setLine(315), _define_let40(_ident122, _line121)); let _sym_id123 = r_150; -(runtime.setLine(318), _emit36((runtime.setLine(318), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: ";\nlet _%% = r_%" }), _ident122, _sym_id123, _base_reg119)))); +(runtime.setLine(316), _emit36((runtime.setLine(316), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: ";\nlet _%% = r_%" }), _ident122, _sym_id123, _base_reg119)))); } else { if (runtime.truthy(runtime.opEq(_pat_ty120, ({ type: "string", value: "list" })))) { const r_151 = _pat118; @@ -520,15 +518,15 @@ const r_155 = ({ type: "int", value: 0 }); let _i125 = r_155; for (const r_156 of _pats124.values) {; let _pat126 = r_156; -const r_157 = (runtime.setLine(340), _let_node_reg_count47()); +const r_157 = (runtime.setLine(322), _let_node_reg_count47()); let _reg127 = r_157; -(runtime.setLine(341), _let_node_reg_increment48()); -(runtime.setLine(342), _emit36((runtime.setLine(342), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: ";\nconst r_% = r_%.values[%] ?? { type: \"null\"}" }), _reg127, _base_reg119, _i125)))); -(runtime.setLine(346), _emit_let_node33(_pat126, _reg127)); +(runtime.setLine(323), _let_node_reg_increment48()); +(runtime.setLine(324), _emit36((runtime.setLine(324), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: ";\nconst r_% = r_%.values[%] ?? { type: \"null\"}" }), _reg127, _base_reg119, _i125)))); +(runtime.setLine(328), _emit_let_node33(_pat126, _reg127)); (_i125 = runtime.opAdd(_i125, ({ type: "int", value: 1 }))); }; } else { -(runtime.setLine(350), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "malformed pattern on line %" }), _line121)); +(runtime.setLine(332), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "malformed pattern on line %" }), _line121)); }}; ; runtime.popCall(); @@ -542,11 +540,11 @@ const r_160 = r_158.values[1] ?? { type: "null"}; let _left130 = r_160; const r_161 = r_158.values[2] ?? { type: "null"}; let _right131 = r_161; -(runtime.setLine(356), _emit36((runtime.setLine(356), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.%(" }), _id129)))); -(runtime.setLine(357), _emit_expr30(_left130)); -(runtime.setLine(358), _emit36(({ type: "string", value: ", " }))); -(runtime.setLine(359), _emit_expr30(_right131)); -(runtime.setLine(360), _emit36(({ type: "string", value: ")" }))); +(runtime.setLine(338), _emit36((runtime.setLine(338), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.%(" }), _id129)))); +(runtime.setLine(339), _emit_expr30(_left130)); +(runtime.setLine(340), _emit36(({ type: "string", value: ", " }))); +(runtime.setLine(341), _emit_expr30(_right131)); +(runtime.setLine(342), _emit36(({ type: "string", value: ")" }))); ; runtime.popCall(); return { type: "null" }; @@ -561,7 +559,7 @@ let _target_type135 = r_165; const r_166 = r_162.values[2] ?? { type: "null"}; let _expr136 = r_166; if (runtime.truthy(runtime.opNe(_target_type135, ({ type: "string", value: "ident" })))) { -(runtime.setLine(366), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "cannot assign to expression on line %" }), _line133)); +(runtime.setLine(348), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "cannot assign to expression on line %" }), _line133)); }; const r_167 = _s132; const r_168 = r_167.values[0] ?? { type: "null"}; @@ -570,10 +568,10 @@ const r_170 = r_169.values[0] ?? { type: "null"}; const r_171 = r_169.values[1] ?? { type: "null"}; const r_172 = r_169.values[2] ?? { type: "null"}; let _ident137 = r_172; -const r_173 = (runtime.setLine(369), _get_sym45(_ident137)); +const r_173 = (runtime.setLine(351), _get_sym45(_ident137)); let _sym138 = r_173; if (runtime.truthy(runtime.opEq(_sym138, ({ type: "null" })))) { -(runtime.setLine(371), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "could not find symbol '%' on line %" }), _ident137, _line133)); +(runtime.setLine(353), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "could not find symbol '%' on line %" }), _ident137, _line133)); }; const r_174 = _sym138; const r_175 = r_174.values[0] ?? { type: "null"}; @@ -584,25 +582,25 @@ const r_177 = r_174.values[2] ?? { type: "null"}; let _sym_ident141 = r_177; const r_178 = r_174.values[3] ?? { type: "null"}; if (runtime.truthy(runtime.opEq(_sym_type140, ({ type: "string", value: "let" })))) { -(runtime.setLine(375), _emit36((runtime.setLine(375), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(_%% = " }), _sym_ident141, _sym_id139)))); +(runtime.setLine(357), _emit36((runtime.setLine(357), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "(_%% = " }), _sym_ident141, _sym_id139)))); if (runtime.truthy(runtime.opEq(_id134, ({ type: "string", value: "=" })))) { -(runtime.setLine(377), _emit_expr30(_expr136)); +(runtime.setLine(359), _emit_expr30(_expr136)); } else { if (runtime.truthy(runtime.opEq(_id134, ({ type: "string", value: "+" })))) { -(runtime.setLine(379), _emit36((runtime.setLine(379), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.opAdd(_%%, " }), _sym_ident141, _sym_id139)))); -(runtime.setLine(380), _emit_expr30(_expr136)); -(runtime.setLine(381), _emit36(({ type: "string", value: ")" }))); +(runtime.setLine(361), _emit36((runtime.setLine(361), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.opAdd(_%%, " }), _sym_ident141, _sym_id139)))); +(runtime.setLine(362), _emit_expr30(_expr136)); +(runtime.setLine(363), _emit36(({ type: "string", value: ")" }))); } else { if (runtime.truthy(runtime.opEq(_id134, ({ type: "string", value: "-" })))) { -(runtime.setLine(383), _emit36((runtime.setLine(383), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.opSub(_%%, " }), _sym_ident141, _sym_id139)))); -(runtime.setLine(384), _emit_expr30(_expr136)); -(runtime.setLine(385), _emit36(({ type: "string", value: ")" }))); +(runtime.setLine(365), _emit36((runtime.setLine(365), ((...args) => runtime.builtinFormat(...args))(({ type: "string", value: "runtime.opSub(_%%, " }), _sym_ident141, _sym_id139)))); +(runtime.setLine(366), _emit_expr30(_expr136)); +(runtime.setLine(367), _emit36(({ type: "string", value: ")" }))); } else { -(runtime.setLine(387), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented" }))); +(runtime.setLine(369), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "not implemented" }))); }}}; -(runtime.setLine(389), _emit36(({ type: "string", value: ")" }))); +(runtime.setLine(371), _emit36(({ type: "string", value: ")" }))); } else { -(runtime.setLine(391), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "cannot assign to symbol '%' on line %" }), _sym_ident141, _line133)); +(runtime.setLine(373), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "cannot assign to symbol '%' on line %" }), _sym_ident141, _line133)); }; ; runtime.popCall(); @@ -610,17 +608,17 @@ return { type: "null" }; }; function _emit36(_str142) { runtime.pushCall("emit"); -(runtime.setLine(396), ((...args) => runtime.builtinPush(...args))(_output41, _str142)); +(runtime.setLine(378), ((...args) => runtime.builtinPush(...args))(_output41, _str142)); ; runtime.popCall(); return { type: "null" }; }; function _define_builtin37(_ident143, _builtin_id144) { runtime.pushCall("define_builtin"); -const r_179 = (runtime.setLine(400), _sym_id_count49()); +const r_179 = (runtime.setLine(382), _sym_id_count49()); let _sym_id145 = r_179; -(runtime.setLine(401), _sym_id_increment50()); -(runtime.setLine(403), _define_sym44(_ident143, ({ type: "list", values: [_sym_id145, ({ type: "string", value: "builtin" }), _builtin_id144] }))); +(runtime.setLine(383), _sym_id_increment50()); +(runtime.setLine(385), _define_sym44(_ident143, ({ type: "list", values: [_sym_id145, ({ type: "string", value: "builtin" }), _builtin_id144] }))); runtime.popCall(); return _sym_id145; ; @@ -629,10 +627,10 @@ return { type: "null" }; }; function _define_fn38(_ident146, _line147) { runtime.pushCall("define_fn"); -const r_180 = (runtime.setLine(408), _sym_id_count49()); +const r_180 = (runtime.setLine(390), _sym_id_count49()); let _sym_id148 = r_180; -(runtime.setLine(409), _sym_id_increment50()); -(runtime.setLine(411), _define_sym44(_ident146, ({ type: "list", values: [_sym_id148, ({ type: "string", value: "fn" }), _ident146, _line147] }))); +(runtime.setLine(391), _sym_id_increment50()); +(runtime.setLine(393), _define_sym44(_ident146, ({ type: "list", values: [_sym_id148, ({ type: "string", value: "fn" }), _ident146, _line147] }))); runtime.popCall(); return _sym_id148; ; @@ -641,10 +639,10 @@ return { type: "null" }; }; function _define_param39(_ident149, _line150) { runtime.pushCall("define_param"); -const r_181 = (runtime.setLine(416), _sym_id_count49()); +const r_181 = (runtime.setLine(398), _sym_id_count49()); let _sym_id151 = r_181; -(runtime.setLine(417), _sym_id_increment50()); -(runtime.setLine(419), _define_sym44(_ident149, ({ type: "list", values: [_sym_id151, ({ type: "string", value: "param" }), _ident149, _line150] }))); +(runtime.setLine(399), _sym_id_increment50()); +(runtime.setLine(401), _define_sym44(_ident149, ({ type: "list", values: [_sym_id151, ({ type: "string", value: "param" }), _ident149, _line150] }))); runtime.popCall(); return _sym_id151; ; @@ -653,10 +651,10 @@ return { type: "null" }; }; function _define_let40(_ident152, _line153) { runtime.pushCall("define_let"); -const r_182 = (runtime.setLine(424), _sym_id_count49()); +const r_182 = (runtime.setLine(406), _sym_id_count49()); let _sym_id154 = r_182; -(runtime.setLine(425), _sym_id_increment50()); -(runtime.setLine(427), _define_sym44(_ident152, ({ type: "list", values: [_sym_id154, ({ type: "string", value: "let" }), _ident152, _line153] }))); +(runtime.setLine(407), _sym_id_increment50()); +(runtime.setLine(409), _define_sym44(_ident152, ({ type: "list", values: [_sym_id154, ({ type: "string", value: "let" }), _ident152, _line153] }))); runtime.popCall(); return _sym_id154; ; @@ -725,20 +723,20 @@ let _map169 = r_190; const r_191 = ({ type: "int", value: 0 }); let _i170 = r_191; while (true) { -if (runtime.truthy(runtime.opGte(_i170, (runtime.setLine(464), ((...args) => runtime.builtinLen(...args))(_map169))))) { +if (runtime.truthy(runtime.opGte(_i170, (runtime.setLine(446), ((...args) => runtime.builtinLen(...args))(_map169))))) { break}; -const r_192 = (runtime.setLine(465), ((...args) => runtime.builtinAt(...args))(_map169, _i170)); +const r_192 = (runtime.setLine(447), ((...args) => runtime.builtinAt(...args))(_map169, _i170)); const r_193 = r_192.values[0] ?? { type: "null"}; let _s_ident171 = r_193; const r_194 = r_192.values[1] ?? { type: "null"}; if (runtime.truthy(runtime.opEq(_ident167, _s_ident171))) { -(runtime.setLine(467), ((...args) => runtime.builtinSet(...args))(_map169, _i170, ({ type: "list", values: [_ident167, _sym168] }))); +(runtime.setLine(449), ((...args) => runtime.builtinSet(...args))(_map169, _i170, ({ type: "list", values: [_ident167, _sym168] }))); runtime.popCall(); return { type: "null" }; }; (_i170 = runtime.opAdd(_i170, ({ type: "int", value: 1 }))); }; -(runtime.setLine(472), ((...args) => runtime.builtinPush(...args))(_map169, ({ type: "list", values: [_ident167, _sym168] }))); +(runtime.setLine(454), ((...args) => runtime.builtinPush(...args))(_map169, ({ type: "list", values: [_ident167, _sym168] }))); ; runtime.popCall(); return { type: "null" }; @@ -753,9 +751,9 @@ let _map175 = r_197; const r_198 = ({ type: "int", value: 0 }); let _i176 = r_198; while (true) { -if (runtime.truthy(runtime.opGte(_i176, (runtime.setLine(479), ((...args) => runtime.builtinLen(...args))(_map175))))) { +if (runtime.truthy(runtime.opGte(_i176, (runtime.setLine(461), ((...args) => runtime.builtinLen(...args))(_map175))))) { break}; -const r_199 = (runtime.setLine(480), ((...args) => runtime.builtinAt(...args))(_map175, _i176)); +const r_199 = (runtime.setLine(462), ((...args) => runtime.builtinAt(...args))(_map175, _i176)); const r_200 = r_199.values[0] ?? { type: "null"}; let _s_ident177 = r_200; const r_201 = r_199.values[1] ?? { type: "null"}; @@ -768,7 +766,7 @@ return _s_sym178; }; if (runtime.truthy(runtime.opNe(_parent174, ({ type: "null" })))) { runtime.popCall(); -return (runtime.setLine(487), _find_sym161(_parent174, _ident173)); +return (runtime.setLine(469), _find_sym161(_parent174, _ident173)); }; runtime.popCall(); return ({ type: "null" }); @@ -779,7 +777,7 @@ return { type: "null" }; function _get162(_ident179) { runtime.pushCall("get"); runtime.popCall(); -return (runtime.setLine(493), _find_sym161(_syms165, _ident179)); +return (runtime.setLine(475), _find_sym161(_syms165, _ident179)); ; runtime.popCall(); return { type: "null" }; @@ -796,10 +794,10 @@ const r_206 = r_205.values[0] ?? { type: "null"}; let _ident184 = r_206; const r_207 = r_205.values[1] ?? { type: "null"}; let _sym185 = r_207; -(runtime.setLine(499), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%- %: %" }), (runtime.setLine(499), _indent23(_depth181)), _ident184, _sym185)); +(runtime.setLine(481), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%- %: %" }), (runtime.setLine(481), _indent23(_depth181)), _ident184, _sym185)); }; if (runtime.truthy(runtime.opNe(_parent182, ({ type: "null" })))) { -(runtime.setLine(502), _print_syms_node163(_parent182, runtime.opAdd(_depth181, ({ type: "int", value: 1 })))); +(runtime.setLine(484), _print_syms_node163(_parent182, runtime.opAdd(_depth181, ({ type: "int", value: 1 })))); }; ; runtime.popCall(); @@ -807,7 +805,7 @@ return { type: "null" }; }; function _print_syms164() { runtime.pushCall("print_syms"); -(runtime.setLine(507), _print_syms_node163(_syms165, ({ type: "int", value: 0 }))); +(runtime.setLine(489), _print_syms_node163(_syms165, ({ type: "int", value: 0 }))); ; runtime.popCall(); return { type: "null" }; @@ -820,7 +818,7 @@ return { type: "null" }; }; function _string_escape17(_str186) { runtime.pushCall("string_escape"); -const r_208 = (runtime.setLine(521), ((...args) => runtime.builtinLen(...args))(_str186)); +const r_208 = (runtime.setLine(503), ((...args) => runtime.builtinLen(...args))(_str186)); let _str_len187 = r_208; const r_209 = ({ type: "int", value: 0 }); let _i188 = r_209; @@ -829,7 +827,7 @@ let _result189 = r_210; while (true) { if (runtime.truthy(runtime.opGte(_i188, _str_len187))) { break}; -const r_211 = (runtime.setLine(526), ((...args) => runtime.builtinAt(...args))(_str186, _i188)); +const r_211 = (runtime.setLine(508), ((...args) => runtime.builtinAt(...args))(_str186, _i188)); let _ch190 = r_211; if (runtime.truthy(runtime.opEq(_ch190, ({ type: "string", value: "\\" })))) { (_result189 = runtime.opAdd(_result189, ({ type: "string", value: "\\\\" }))); @@ -863,16 +861,16 @@ function _Parser18(_tokens191) { runtime.pushCall("Parser"); const r_212 = ({ type: "int", value: 0 }); let _i198 = r_212; -const r_213 = (runtime.setLine(549), ((...args) => runtime.builtinAt(...args))(_tokens191, _i198)); +const r_213 = (runtime.setLine(531), ((...args) => runtime.builtinAt(...args))(_tokens191, _i198)); let _tok199 = r_213; function _parse192() { runtime.pushCall("parse"); const r_214 = ({ type: "list", values: [] }); let _exprs200 = r_214; while (true) { -if (runtime.truthy((runtime.setLine(554), _done197()))) { +if (runtime.truthy((runtime.setLine(536), _done197()))) { break}; -(runtime.setLine(555), ((...args) => runtime.builtinPush(...args))(_exprs200, (runtime.setLine(555), _parse_expr193()))); +(runtime.setLine(537), ((...args) => runtime.builtinPush(...args))(_exprs200, (runtime.setLine(537), _parse_expr193()))); }; runtime.popCall(); return _exprs200; @@ -889,33 +887,33 @@ const r_217 = r_215.values[1] ?? { type: "null"}; let _line202 = r_217; const r_218 = r_215.values[2] ?? { type: "null"}; let _value203 = r_218; -if (runtime.truthy((runtime.setLine(562), _eat194(({ type: "string", value: "(" }))))) { +if (runtime.truthy((runtime.setLine(544), _eat194(({ type: "string", value: "(" }))))) { const r_219 = ({ type: "list", values: [] }); let _values204 = r_219; while (true) { -if (runtime.truthy((runtime.setLine(565), _test196(({ type: "string", value: ")" }))))) { +if (runtime.truthy((runtime.setLine(547), _test196(({ type: "string", value: ")" }))))) { break}; -(runtime.setLine(566), ((...args) => runtime.builtinPush(...args))(_values204, (runtime.setLine(566), _parse_expr193()))); +(runtime.setLine(548), ((...args) => runtime.builtinPush(...args))(_values204, (runtime.setLine(548), _parse_expr193()))); }; -if (runtime.truthy(runtime.opNot((runtime.setLine(568), _eat194(({ type: "string", value: ")" })))))) { -(runtime.setLine(569), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected ')' on line %" }), (runtime.setLine(569), ((...args) => runtime.builtinAt(...args))(_tok199, ({ type: "int", value: 1 }))))); +if (runtime.truthy(runtime.opNot((runtime.setLine(550), _eat194(({ type: "string", value: ")" })))))) { +(runtime.setLine(551), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected ')' on line %" }), (runtime.setLine(551), ((...args) => runtime.builtinAt(...args))(_tok199, ({ type: "int", value: 1 }))))); }; runtime.popCall(); return ({ type: "list", values: [({ type: "string", value: "list" }), _line202, _values204] }); } else { -if (runtime.truthy((runtime.setLine(572), _eat194(({ type: "string", value: "string" }))))) { +if (runtime.truthy((runtime.setLine(554), _eat194(({ type: "string", value: "string" }))))) { runtime.popCall(); return ({ type: "list", values: [({ type: "string", value: "string" }), _line202, _value203] }); } else { -if (runtime.truthy((runtime.setLine(574), _eat194(({ type: "string", value: "int" }))))) { +if (runtime.truthy((runtime.setLine(556), _eat194(({ type: "string", value: "int" }))))) { runtime.popCall(); -return ({ type: "list", values: [({ type: "string", value: "int" }), _line202, (runtime.setLine(575), ((...args) => runtime.builtinStringToInt(...args))(_value203))] }); +return ({ type: "list", values: [({ type: "string", value: "int" }), _line202, (runtime.setLine(557), ((...args) => runtime.builtinStringToInt(...args))(_value203))] }); } else { -if (runtime.truthy((runtime.setLine(576), _eat194(({ type: "string", value: "ident" }))))) { +if (runtime.truthy((runtime.setLine(558), _eat194(({ type: "string", value: "ident" }))))) { runtime.popCall(); return ({ type: "list", values: [({ type: "string", value: "ident" }), _line202, _value203] }); } else { -(runtime.setLine(579), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected expression, got '%' on line %" }), _ty201, _line202)); +(runtime.setLine(561), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected expression, got '%' on line %" }), _ty201, _line202)); }}}}; ; runtime.popCall(); @@ -923,10 +921,10 @@ return { type: "null" }; }; function _eat194(_pat205) { runtime.pushCall("eat"); -if (runtime.truthy(runtime.opNot((runtime.setLine(584), _test196(_pat205))))) { +if (runtime.truthy(runtime.opNot((runtime.setLine(566), _test196(_pat205))))) { runtime.popCall(); return ({ type: "bool", value: false })}; -(runtime.setLine(585), _step195()); +(runtime.setLine(567), _step195()); runtime.popCall(); return ({ type: "bool", value: true }); ; @@ -936,8 +934,8 @@ return { type: "null" }; function _step195() { runtime.pushCall("step"); (_i198 = runtime.opAdd(_i198, ({ type: "int", value: 1 }))); -if (runtime.truthy(runtime.opNot((runtime.setLine(591), _done197())))) { -const r_220 = (runtime.setLine(592), ((...args) => runtime.builtinAt(...args))(_tokens191, _i198)); +if (runtime.truthy(runtime.opNot((runtime.setLine(573), _done197())))) { +const r_220 = (runtime.setLine(574), ((...args) => runtime.builtinAt(...args))(_tokens191, _i198)); let _new_tok206 = r_220; (_tok199 = _new_tok206); }; @@ -947,7 +945,7 @@ return { type: "null" }; }; function _test196(_pat207) { runtime.pushCall("test"); -if (runtime.truthy((runtime.setLine(598), _done197()))) { +if (runtime.truthy((runtime.setLine(580), _done197()))) { runtime.popCall(); return ({ type: "bool", value: false })}; const r_221 = _tok199; @@ -962,7 +960,7 @@ return { type: "null" }; function _done197() { runtime.pushCall("done"); runtime.popCall(); -return runtime.opGte(_i198, (runtime.setLine(604), ((...args) => runtime.builtinLen(...args))(_tokens191))); +return runtime.opGte(_i198, (runtime.setLine(586), ((...args) => runtime.builtinLen(...args))(_tokens191))); ; runtime.popCall(); return { type: "null" }; @@ -975,7 +973,7 @@ return { type: "null" }; }; function _tokenize19(_text209) { runtime.pushCall("tokenize"); -const r_223 = (runtime.setLine(611), ((...args) => runtime.builtinLen(...args))(_text209)); +const r_223 = (runtime.setLine(593), ((...args) => runtime.builtinLen(...args))(_text209)); let _text_len210 = r_223; const r_224 = ({ type: "list", values: [] }); let _tokens211 = r_224; @@ -988,33 +986,33 @@ let _ident_chars214 = r_227; while (true) { if (runtime.truthy(runtime.opGte(_i212, _text_len210))) { break}; -const r_228 = (runtime.setLine(623), ((...args) => runtime.builtinAt(...args))(_text209, _i212)); +const r_228 = (runtime.setLine(605), ((...args) => runtime.builtinAt(...args))(_text209, _i212)); let _ch215 = r_228; -if (runtime.truthy((runtime.setLine(625), _contains20(({ type: "string", value: " \t\r\n" }), _ch215)))) { +if (runtime.truthy((runtime.setLine(607), _contains20(({ type: "string", value: " \t\r\n" }), _ch215)))) { if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\n" })))) { (_line213 = runtime.opAdd(_line213, ({ type: "int", value: 1 }))); }; (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); } else { -if (runtime.truthy((runtime.setLine(630), _slice_eq21(_text209, _i212, ({ type: "string", value: "//" }))))) { +if (runtime.truthy((runtime.setLine(612), _slice_eq21(_text209, _i212, ({ type: "string", value: "//" }))))) { while (true) { -if (runtime.truthy((runtime.setLine(632), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opEq((runtime.setLine(632), ((...args) => runtime.builtinAt(...args))(_text209, _i212)), ({ type: "string", value: "\n" }))) }))) { +if (runtime.truthy((runtime.setLine(614), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opEq((runtime.setLine(614), ((...args) => runtime.builtinAt(...args))(_text209, _i212)), ({ type: "string", value: "\n" }))) }))) { break; }; (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); }; } else { -if (runtime.truthy((runtime.setLine(637), _contains20(({ type: "string", value: "()" }), _ch215)))) { -(runtime.setLine(638), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [_ch215, _line213] }))); +if (runtime.truthy((runtime.setLine(619), _contains20(({ type: "string", value: "()" }), _ch215)))) { +(runtime.setLine(620), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [_ch215, _line213] }))); (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); } else { if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\"" })))) { const r_229 = ({ type: "string", value: "" }); let _value216 = r_229; (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); -(_ch215 = (runtime.setLine(643), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); +(_ch215 = (runtime.setLine(625), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); while (true) { -if (runtime.truthy((runtime.setLine(645), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\"" }))) }))) { +if (runtime.truthy((runtime.setLine(627), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\"" }))) }))) { break; }; if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\\" })))) { @@ -1022,7 +1020,7 @@ if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "\\" })))) { if (runtime.truthy(runtime.opGte(_i212, _text_len210))) { break; }; -(_ch215 = (runtime.setLine(653), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); +(_ch215 = (runtime.setLine(635), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "t" })))) { (_value216 = runtime.opAdd(_value216, ({ type: "string", value: "\t" }))); } else { @@ -1041,41 +1039,41 @@ if (runtime.truthy(runtime.opEq(_ch215, ({ type: "string", value: "0" })))) { (_value216 = runtime.opAdd(_value216, _ch215)); }; (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); -(_ch215 = (runtime.setLine(669), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); +(_ch215 = (runtime.setLine(651), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); }; -if (runtime.truthy((runtime.setLine(671), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNe(_ch215, ({ type: "string", value: "\"" }))) }))) { -(runtime.setLine(672), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected '\"' on line %" }), _line213)); +if (runtime.truthy((runtime.setLine(653), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNe(_ch215, ({ type: "string", value: "\"" }))) }))) { +(runtime.setLine(654), ((...args) => runtime.builtinPanic(...args))(({ type: "string", value: "expected '\"' on line %" }), _line213)); }; (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); -(runtime.setLine(675), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "string" }), _line213, _value216] }))); +(runtime.setLine(657), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "string" }), _line213, _value216] }))); } else { -if (runtime.truthy((runtime.setLine(676), _contains20(({ type: "string", value: "0123456789" }), _ch215)))) { +if (runtime.truthy((runtime.setLine(658), _contains20(({ type: "string", value: "0123456789" }), _ch215)))) { const r_230 = ({ type: "string", value: "" }); let _value217 = r_230; while (true) { -(_ch215 = (runtime.setLine(679), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); -if (runtime.truthy((runtime.setLine(680), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNot((runtime.setLine(680), _contains20(({ type: "string", value: "0123456789" }), _ch215)))) }))) { +(_ch215 = (runtime.setLine(661), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); +if (runtime.truthy((runtime.setLine(662), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNot((runtime.setLine(662), _contains20(({ type: "string", value: "0123456789" }), _ch215)))) }))) { break; }; (_value217 = runtime.opAdd(_value217, _ch215)); (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); }; -(runtime.setLine(686), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "int" }), _line213, _value217] }))); +(runtime.setLine(668), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "int" }), _line213, _value217] }))); } else { -if (runtime.truthy((runtime.setLine(687), _contains20(_ident_chars214, _ch215)))) { +if (runtime.truthy((runtime.setLine(669), _contains20(_ident_chars214, _ch215)))) { const r_231 = ({ type: "string", value: "" }); let _value218 = r_231; while (true) { -(_ch215 = (runtime.setLine(690), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); -if (runtime.truthy((runtime.setLine(691), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNot((runtime.setLine(691), _contains20(_ident_chars214, _ch215)))) }))) { +(_ch215 = (runtime.setLine(672), ((...args) => runtime.builtinAt(...args))(_text209, _i212))); +if (runtime.truthy((runtime.setLine(673), { type: "bool", value: runtime.truthy(runtime.opGte(_i212, _text_len210)) || runtime.truthy(runtime.opNot((runtime.setLine(673), _contains20(_ident_chars214, _ch215)))) }))) { break; }; (_value218 = runtime.opAdd(_value218, _ch215)); (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); }; -(runtime.setLine(697), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "ident" }), _line213, _value218] }))); +(runtime.setLine(679), ((...args) => runtime.builtinPush(...args))(_tokens211, ({ type: "list", values: [({ type: "string", value: "ident" }), _line213, _value218] }))); } else { -(runtime.setLine(699), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "illegal char '%'" }), _ch215)); +(runtime.setLine(681), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "illegal char '%'" }), _ch215)); (_i212 = runtime.opAdd(_i212, ({ type: "int", value: 1 }))); }}}}}}; }; @@ -1087,14 +1085,14 @@ return { type: "null" }; }; function _contains20(_text219, _ch220) { runtime.pushCall("contains"); -const r_232 = (runtime.setLine(707), ((...args) => runtime.builtinLen(...args))(_text219)); +const r_232 = (runtime.setLine(689), ((...args) => runtime.builtinLen(...args))(_text219)); let _text_len221 = r_232; const r_233 = ({ type: "int", value: 0 }); let _i222 = r_233; while (true) { if (runtime.truthy(runtime.opGte(_i222, _text_len221))) { break}; -if (runtime.truthy(runtime.opEq((runtime.setLine(711), ((...args) => runtime.builtinAt(...args))(_text219, _i222)), _ch220))) { +if (runtime.truthy(runtime.opEq((runtime.setLine(693), ((...args) => runtime.builtinAt(...args))(_text219, _i222)), _ch220))) { runtime.popCall(); return ({ type: "bool", value: true }); }; @@ -1108,9 +1106,9 @@ return { type: "null" }; }; function _slice_eq21(_str223, _slice_idx224, _substr225) { runtime.pushCall("slice_eq"); -const r_234 = (runtime.setLine(720), ((...args) => runtime.builtinLen(...args))(_str223)); +const r_234 = (runtime.setLine(702), ((...args) => runtime.builtinLen(...args))(_str223)); let _str_len226 = r_234; -const r_235 = (runtime.setLine(721), ((...args) => runtime.builtinLen(...args))(_substr225)); +const r_235 = (runtime.setLine(703), ((...args) => runtime.builtinLen(...args))(_substr225)); let _substr_len227 = r_235; const r_236 = ({ type: "int", value: 0 }); let _i228 = r_236; @@ -1121,7 +1119,7 @@ return ({ type: "bool", value: true })}; if (runtime.truthy(runtime.opGte(runtime.opAdd(_slice_idx224, _i228), _str_len226))) { runtime.popCall(); return ({ type: "bool", value: false })}; -if (runtime.truthy(runtime.opNe((runtime.setLine(728), ((...args) => runtime.builtinAt(...args))(_str223, runtime.opAdd(_slice_idx224, _i228))), (runtime.setLine(728), ((...args) => runtime.builtinAt(...args))(_substr225, _i228))))) { +if (runtime.truthy(runtime.opNe((runtime.setLine(710), ((...args) => runtime.builtinAt(...args))(_str223, runtime.opAdd(_slice_idx224, _i228))), (runtime.setLine(710), ((...args) => runtime.builtinAt(...args))(_substr225, _i228))))) { runtime.popCall(); return ({ type: "bool", value: false })}; (_i228 = runtime.opAdd(_i228, ({ type: "int", value: 1 }))); @@ -1142,14 +1140,14 @@ let _line232 = r_239; const r_240 = r_237.values[2] ?? { type: "null"}; let _value233 = r_240; if (runtime.truthy(runtime.opEq(_ty231, ({ type: "string", value: "list" })))) { -(runtime.setLine(738), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%(% %" }), (runtime.setLine(738), _indent23(_depth230)), _ty231, _line232)); +(runtime.setLine(720), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%(% %" }), (runtime.setLine(720), _indent23(_depth230)), _ty231, _line232)); for (const r_241 of _value233.values) {; let _e234 = r_241; -(runtime.setLine(740), _print_expr22(_e234, runtime.opAdd(_depth230, ({ type: "int", value: 1 })))); +(runtime.setLine(722), _print_expr22(_e234, runtime.opAdd(_depth230, ({ type: "int", value: 1 })))); }; -(runtime.setLine(742), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%)" }), (runtime.setLine(742), _indent23(_depth230)))); +(runtime.setLine(724), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%)" }), (runtime.setLine(724), _indent23(_depth230)))); } else { -(runtime.setLine(744), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%%" }), (runtime.setLine(744), _indent23(_depth230)), _expr229)); +(runtime.setLine(726), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "%%" }), (runtime.setLine(726), _indent23(_depth230)), _expr229)); }; ; runtime.popCall(); @@ -1175,7 +1173,7 @@ return { type: "null" }; }; function _slice24(_list238, _idx239) { runtime.pushCall("slice"); -const r_244 = (runtime.setLine(760), ((...args) => runtime.builtinLen(...args))(_list238)); +const r_244 = (runtime.setLine(742), ((...args) => runtime.builtinLen(...args))(_list238)); let _list_len240 = r_244; const r_245 = ({ type: "list", values: [] }); let _elems241 = r_245; @@ -1184,7 +1182,7 @@ let _i242 = r_246; while (true) { if (runtime.truthy(runtime.opGte(_i242, _list_len240))) { break}; -(runtime.setLine(765), ((...args) => runtime.builtinPush(...args))(_elems241, (runtime.setLine(765), ((...args) => runtime.builtinAt(...args))(_list238, _i242)))); +(runtime.setLine(747), ((...args) => runtime.builtinPush(...args))(_elems241, (runtime.setLine(747), ((...args) => runtime.builtinAt(...args))(_list238, _i242)))); (_i242 = runtime.opAdd(_i242, ({ type: "int", value: 1 }))); }; runtime.popCall(); @@ -1195,37 +1193,37 @@ return { type: "null" }; }; const r_247 = ({ type: "bool", value: false }); let _silent243 = r_247; -const r_248 = (runtime.setLine(773), ((...args) => runtime.builtinGetArgs(...args))()); +const r_248 = (runtime.setLine(755), ((...args) => runtime.builtinGetArgs(...args))()); const r_249 = r_248.values[0] ?? { type: "null"}; let _input_filename244 = r_249; const r_250 = r_248.values[1] ?? { type: "null"}; let _output_filename245 = r_250; if (runtime.truthy(runtime.opNot(_silent243))) { -(runtime.setLine(775), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "reading file '%'..." }), _input_filename244))}; -const r_251 = (runtime.setLine(776), ((...args) => runtime.builtinReadTextFile(...args))(_input_filename244)); +(runtime.setLine(757), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "reading file '%'..." }), _input_filename244))}; +const r_251 = (runtime.setLine(758), ((...args) => runtime.builtinReadTextFile(...args))(_input_filename244)); let _text246 = r_251; if (runtime.truthy(runtime.opNot(_silent243))) { -(runtime.setLine(782), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "tokenizing..." })))}; -const r_252 = (runtime.setLine(783), _tokenize19(_text246)); +(runtime.setLine(764), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "tokenizing..." })))}; +const r_252 = (runtime.setLine(765), _tokenize19(_text246)); let _tokens247 = r_252; if (runtime.truthy(runtime.opNot(_silent243))) { -(runtime.setLine(796), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "parsing..." })))}; -const r_253 = (runtime.setLine(797), _Parser18(_tokens247)); +(runtime.setLine(778), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "parsing..." })))}; +const r_253 = (runtime.setLine(779), _Parser18(_tokens247)); let _parser248 = r_253; const r_254 = _parser248; const r_255 = r_254.values[0] ?? { type: "null"}; let _parse249 = r_255; -const r_256 = (runtime.setLine(799), _parse249()); +const r_256 = (runtime.setLine(781), _parse249()); let _ast250 = r_256; if (runtime.truthy(runtime.opNot(_silent243))) { -(runtime.setLine(806), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "emitting..." })))}; -const r_257 = (runtime.setLine(807), _Emitter14(_ast250, _input_filename244)); +(runtime.setLine(788), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "emitting..." })))}; +const r_257 = (runtime.setLine(789), _Emitter14(_ast250, _input_filename244)); let _emitter251 = r_257; const r_258 = _emitter251; const r_259 = r_258.values[0] ?? { type: "null"}; let _emit252 = r_259; -const r_260 = (runtime.setLine(809), _emit252()); +const r_260 = (runtime.setLine(791), _emit252()); let _js_code253 = r_260; if (runtime.truthy(runtime.opNot(_silent243))) { -(runtime.setLine(814), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "writing file '%'..." }), _output_filename245))}; -(runtime.setLine(815), ((...args) => runtime.builtinWriteTextFile(...args))(_output_filename245, _js_code253)); +(runtime.setLine(796), ((...args) => runtime.builtinPrintln(...args))(({ type: "string", value: "writing file '%'..." }), _output_filename245))}; +(runtime.setLine(797), ((...args) => runtime.builtinWriteTextFile(...args))(_output_filename245, _js_code253));