+ const vis = row => row.split(/\n/)[3].trim().replaceAll(/<.*?>/g,'').replaceAll(/\.\.+/g,'..')
+ list.sort((a,b) => vis(a)>vis(b) ? 1 : -1)
+ res.send(style('usage')+`
+ <p><table>${files.tally().map(([k,v]) => `<tr><td>${v}<td>${k}`).join("\n")}</table>
+ <p><table>${list.join("\n")}</table>`)
+})
+
+app.get('/nesting', (req,res) => {
+ const {file,type,start,end} = req.query
+ const result = []
+ const doit = (branch,stack) => {
+ if(stack.at(-1)==file && branch.type==type && branch.start==start && branch.end==end) {
+ const file = stack.at(-1)
+ const path = stack.slice(0,-1).map((n,i) => `
+ <tr>
+ <td><a title=${file} href=/similar?pos=${`${file}-${start}-${end}`}&depth=${i}>${n.type}</a>:
+ <td>${sxpr(n,3,null,stack[i-1])}`).reverse()
+ const hit = stack[1]
+ result.push(`
+ <p><table>${path.join("")}</table><br>
+ <p><pre>${escape(JSON.stringify(hit,omit,2))}</pre>`)
+ }
+ }
+ visitor.wander(mods,doit)
+ res.send(style('nesting')+`${result.join("<hr>")}`)