Changeset f924e4b
- Timestamp:
- 03/10/14 16:20:00 (11 years ago)
- Branches:
- master
- Children:
- 519eaf5
- Parents:
- f600a02
- git-author:
- Tomasz Obrebski <obrebski@…> (03/10/14 16:20:00)
- git-committer:
- Tomasz Obrebski <obrebski@…> (03/10/14 16:20:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tre/tre
rd6a59ca rf924e4b 233 233 end 234 234 235 # old: 236 # def printpar(root,arcs) 237 # print nodeinfo(root) 238 # deps = arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] } 239 # unless deps == [] 240 # print '(' 241 # cont=false 242 # for arc in deps 243 # if cont then print ',' else cont=true end 244 # print arc[2],':' if $INFO =~ /l/ 245 # printpar(arc[1],arcs) 246 # end 247 # print ')' 248 # end 249 # end 250 235 251 def printpar(root,arcs) 236 print nodeinfo(root) 237 deps = arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] } 238 unless deps == [] 239 print '(' 240 cont=false 241 for arc in deps 242 if cont then print ',' else cont=true end 243 print arc[2],':' if $INFO =~ /l/ 244 printpar(arc[1],arcs) 245 end 252 253 ldeps = arcs.select{|a| a[0]==root and $gphid[a[1]] < $gphid[root]}.sort{|a,b| $gphid[a[1]]<=>$gphid[b[1]] } 254 rdeps = arcs.select{|a| a[0]==root and $gphid[a[1]] > $gphid[root]}.sort{|a,b| $gphid[a[1]]<=>$gphid[b[1]] } 255 256 for arc in ldeps 257 print ' (' 258 print arc[2].upcase if $INFO =~ /l/ 259 printpar(arc[1],arcs) 260 print ')' 261 end 262 263 print ' ',nodeinfo(root) 264 265 for arc in rdeps 266 print ' (' 267 print arc[2].upcase if $INFO =~ /l/ 268 printpar(arc[1],arcs) 246 269 print ')' 247 270 end
Note: See TracChangeset
for help on using the changeset viewer.