(symbolTree, indent)
| 527 | // construct a string like {Foo: s1, Bar: {Baz: s2, Quux: {A: s3, B: s4}}} |
| 528 | // except with pretty indentation. |
| 529 | var writeSymbolTree = function (symbolTree, indent) { |
| 530 | var put = function (node, indent) { |
| 531 | if (typeof node === "string") { |
| 532 | return node; |
| 533 | } |
| 534 | if (_.keys(node).length === 0) { |
| 535 | return '{}'; |
| 536 | } |
| 537 | var spacing = new Array(indent + 1).join(' '); |
| 538 | // XXX prettyprint! |
| 539 | return "{\n" + |
| 540 | _.map(node, function (value, key) { |
| 541 | return spacing + " " + key + ": " + put(value, indent + 2); |
| 542 | }).join(',\n') + "\n" + spacing + "}"; |
| 543 | }; |
| 544 | |
| 545 | return put(symbolTree, indent || 0); |
| 546 | }; |
| 547 | |
| 548 | |
| 549 | /////////////////////////////////////////////////////////////////////////////// |
no test coverage detected
searching dependent graphs…