+ visitor.walk(mods,doit)
+ res.send(style('nesting',key)+`${result.join("<hr>")}`)
+})
+
+app.get('/similar', (req,res) => {
+ const {file,type,key,start,end,nest} = req.query
+ let nested
+ visitor.walk(mods,(branch,stack) => {
+ if(stack.at(-1)==file && branch.type==type && branch.start==start && branch.end==end)
+ nested = stack[nest]
+ })
+ const norm = node => vis(`\n\n\n${sxpr(node,3,null)}`)
+ const source = (file,node) => mods.find(mod => mod.file == file).text.substring(+node.start,+node.end)
+ const want = norm(nested)
+ const result = []
+ visitor.walk(mods,(branch,stack) => {
+ if(norm(branch) == want) result.push(`<pre>${escape(source(stack.at(-1),branch))}</pre><hr>`)
+ })
+ res.send(style('similar',key)+
+ `<p>${want}<hr>` +
+ result.join("\n")
+ )