Commits

ZyX_I committed 8a5a3b6

@/fwc/constructor: Made it use self._comp instead of s:comp

  • Participants
  • Parent commits fc719ee

Comments (0)

Files changed (2)

plugin/frawor/fwc/constructor.vim

 "▶1 Header
 scriptencoding utf-8
-execute frawor#Setup('1.0', {'@/resources': '0.0'}, 1)
+execute frawor#Setup('1.1', {'@/resources': '0.0'}, 1)
 let s:constructor={}
 let s:comp={}
+let s:constructor._comp=s:comp
 "▶1 string     :: a → String
 function s:constructor.string(val)
     if type(a:val)==type('') && a:val=~#"[\r\n@]"
             call add(r, repeat(' ', &sw*indent).item)
         else
             let type=remove(item, 0)
-            if has_key(s:comp, type)
-                call call(s:comp[type], [r, toextend, indent, item], {})
+            if has_key(self._comp, type)
+                call call(self._comp[type], [r, toextend, indent, item], {})
             endif
             if !empty(toextend)
                 call extend(items, remove(toextend, 0, -1), 0)

tools/depstodot.vim

 execute frawor#Setup('0.0', {})
 let s:deps={}
+let s:rtppls={}
+let s:plrtps={}
 let s:dtd={'ignoredeps': 1}
 function s:dtd.register(plugdict, fdict)
     let s:deps[a:plugdict.id]=a:plugdict.dependencies
+    let rtp=a:plugdict.runtimepath
+    if empty(rtp)
+        let rtp='NA'
+    endif
+    if has_key(s:rtppls, rtp)
+        let s:rtppls[rtp]+=[a:plugdict.id]
+    else
+        let s:rtppls[rtp]=[a:plugdict.id]
+    endif
     if a:plugdict.id is# 'plugin/frawor'
         let s:deplen=a:plugdict.g.deplen
         let s:dependents=a:plugdict.g.dependents
     let ranks=map(repeat([[]], max(values(s:deplen))+1), 'copy(v:val)')
     call map(copy(s:deplen), 'add(ranks[v:val], v:key)')
     let lines=['digraph G {']
+    let lines+=['    concentrate = true;']
     let lines+=['    {']
     let lines+=['        node [shape=plaintext]']
     let lines+=['        '.join(range(1, len(ranks)-1), ' -> ').';']
         let i+=1
         let lines+=['    { node [fontcolor='.s:colors[i].']; rank = same; '.i.'; "'.join(nodes, '"; "').'"; }']
     endfor
-    for [plid, dependencies] in items(s:deps)
-        for dplid in keys(dependencies)
+    for [rtp, nodes] in sort(items(s:rtppls))
+        let lines+=['    subgraph "'.rtp.'" {']
+        let lines+=['        label = "'.fnamemodify(rtp, ':t').'";']
+        let lines+=['        "'.join(nodes, '"; "').'";']
+        let lines+=['    }']
+    endfor
+    for [plid, dependencies] in sort(items(s:deps))
+        for dplid in sort(keys(dependencies))
             let lines+=['    edge [color='.s:colors[s:deplen[plid]].'];']
             let lines+=['    "'.plid.'" -> "'.dplid.'";']
         endfor