lib/gen-dot.js
function handle_loop(elem, names) {
		var cond = _dot_inner(elem.cond.fn, false, names);
		var node1 = _dot_inner(elem.fns[0].fn, false, names);
		var builder = [];
		var node2 = node1;

		Array.prototype.push.apply(builder, cond[0]);
		Array.prototype.push.apply(builder, node1[0]);
		builder.push(cond[2]+' [shape=Mdiamond];');
		builder.push(cond[2]+' -> '+node1[1]+' [label = true];');

		for (var i = 1; i < elem.fns.length; ++i) {
			node2 = _dot_inner(elem.fns[i].fn, false, names);
			Array.prototype.push.apply(builder, node2[0]);
			builder.push(node1[2]+' -> '+node2[1]+';');
			node1 = node2;
		}

		builder.push(node2[2]+' -> '+cond[1]+';');
		return [builder, cond[1], cond[2]];
	}
function handle_loop(elem, names) {
		var cond = _dot_inner(elem.cond.fn, false, names);
		var node1 = _dot_inner(elem.fns[0].fn, false, names);
		var builder = [];
		var node2 = node1;

		Array.prototype.push.apply(builder, cond[0]);
		Array.prototype.push.apply(builder, node1[0]);
		builder.push(cond[2]+' [shape=Mdiamond];');
		builder.push(cond[2]+' -> '+node1[1]+' [label = true];');

		for (var i = 1; i < elem.fns.length; ++i) {
			node2 = _dot_inner(elem.fns[i].fn, false, names);
			Array.prototype.push.apply(builder, node2[0]);
			builder.push(node1[2]+' -> '+node2[1]+';');
			node1 = node2;
		}

		builder.push(node2[2]+' -> '+cond[1]+';');
		return [builder, cond[1], cond[2]];
	}
function handle_loop ( elem , names ) { var cond = _dot_inner ( elem . cond . fn , false , names ) ; var node1 = _dot_inner ( elem . fns [ 0 ] . fn , false , names ) ; var builder = [ ] ; var node2 = node1 ; Array . prototype . push . apply ( builder , cond [ 0 ] ) ; Array . prototype . push . apply ( builder , node1 [ 0 ] ) ; builder . push ( cond [ 2 ] + ' [shape=Mdiamond];' ) ; builder . push ( cond [ 2 ] + ' -> ' + node1 [ 1 ] + ' [label = true];' ) ; for ( var i = 1 ; i < elem . fns . length ; ++ i ) { node2 = _dot_inner ( elem . fns [ i ] . fn , false , names ) ; Array . prototype . push . apply ( builder , node2 [ 0 ] ) ; builder . push ( node1 [ 2 ] + ' -> ' + node2 [ 1 ] + ';' ) ; node1 = node2 ; } builder . push ( node2 [ 2 ] + ' -> ' + cond [ 1 ] + ';' ) ; return [ builder , cond [ 1 ] , cond [ 2 ] ] ; }
Handle a loop chain, which is a lot like a serial chain but with a starter
condition node on top
@param elem The loop chain to describe in DOT
@param names The hash table of functions and their names
@return Standard triple of [strings, first element, last element]
Handle a loop chain which is a lot like a serial chain but with a starter condition node on top