X-Git-Url: https://dreyeck.freedombox.rocks/gitweb/idiomatic.git/blobdiff_plain/f0a44e8482fdfa29b5a32d6a407509efe9984e3c..ef2285e8811ba79f54986e32767aa75a87191f86:/index.js?ds=inline
diff --git a/index.js b/index.js
index 020a168..ff1804c 100644
--- a/index.js
+++ b/index.js
@@ -22,21 +22,22 @@ async function load(file) {
// P A G E S
-const style = title => `
+const style = (title,here='') => `
- â ${title} â`
+
${reductions.size()} non-terminals
${reductions.total()} reductions
@@ -58,40 +59,47 @@ app.get('/terminal', (req,res) => {
const {type,field} = req.query
const lits = counter()
const doit = branch => {if(branch.type==type) lits.count(branch[field])}
- visitor.wander(mods,doit)
- const result = style('terminal')+`
+ visitor.walk(mods,doit)
+ const result = style('terminal',type)+`
${lits.size()} uniques
${lits.total()} total
| ${v} | ${escape(k)}`) + .map(([k,v]) => ` |
| ${v} | ${escape(k)}`) .join("\n")} |
| ${v} | ${k}`).join("\n")} |
${files.total()} uses in ${files.size()} files
+ ${files.tally().map(([k,v]) => `
${v} ${k}`).join("\n")}
${escape(JSON.stringify(hit,omit,2))}`)
}
}
- visitor.wander(mods,doit)
- res.send(style('nesting')+`${result.join("