Remove garbage debug
This commit is contained in:
parent
30d9ad05ac
commit
ca7a72c269
3 changed files with 0 additions and 54 deletions
17
dbg.mjs
17
dbg.mjs
|
|
@ -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));
|
||||
18
dbg2.mjs
18
dbg2.mjs
|
|
@ -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));
|
||||
19
dbg3.mjs
19
dbg3.mjs
|
|
@ -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);
|
||||
Loading…
Reference in a new issue