Remove garbage debug

This commit is contained in:
Hellings 2026-10-23 19:14:51 -04:00
parent 30d9ad05ac
commit ca7a72c269
3 changed files with 0 additions and 54 deletions

17
dbg.mjs
View file

@ -1,17 +0,0 @@
import { readFile } from "node:fs/promises";
import { lex } from "./views/engine/lexer.ts";
import { parse } from "./views/engine/parser.ts";
import { compileTemplate } from "./views/engine/compiler.ts";
const src = await readFile(
"./critdotrip/muddle/modules/app/views/index.spug",
"utf8",
);
const tokens = lex(src);
const parsed = parse(tokens);
console.log("frontmatter:", JSON.stringify(parsed.frontmatter));
const { source } = compileTemplate(parsed.nodes, {
path: "/x/index.spug",
dir: "/x",
frontmatter: "",
});
console.log(source.slice(0, 1200));

View file

@ -1,18 +0,0 @@
import { readFile } from "node:fs/promises";
import { lex } from "./views/engine/lexer.ts";
import { parse } from "./views/engine/parser.ts";
import { compileTemplate } from "./views/engine/compiler.ts";
const src = await readFile(
"./critdotrip/muddle/modules/app/views/index.spug",
"utf8",
);
const tokens = lex(src);
const parsed = parse(tokens);
const { source } = compileTemplate(parsed.nodes, {
path: "/x/index.spug",
dir: "/x",
frontmatter: parsed.frontmatter || "",
});
const i = source.indexOf("hellings");
console.log("index", i);
if (i >= 0) console.log(source.slice(Math.max(0, i - 400), i + 200));

View file

@ -1,19 +0,0 @@
import { readFile } from "node:fs/promises";
import { lex } from "./views/engine/lexer.ts";
import { parse } from "./views/engine/parser.ts";
import { compileTemplate } from "./views/engine/compiler.ts";
const src = await readFile(
"./critdotrip/muddle/modules/app/views/index.spug",
"utf8",
);
const parsed = parse(lex(src));
const { source } = compileTemplate(parsed.nodes, {
path: "/x/i.spug",
dir: "/x",
frontmatter: parsed.frontmatter || "",
});
const a = source.indexOf("with (__ctx) {");
const b = source.indexOf('return __out.join(""");', a);
console.log("TEMPLATE BODY START", a);
console.log(source.slice(a, b).slice(0, 400));
console.log("...LEN", b - a);