treeReport function
The report printed by ball tree <input.ball.json> (no trailing newline).
Implementation
String treeReport(Program program) {
final lines = <String>[];
lines.add('${program.name} v${program.version}');
for (final m in program.modules) {
final isBase = _allBase(m.functions) && m.functions.isNotEmpty;
final tag = isBase ? ' (base)' : '';
final fnCount = m.functions.length;
lines.add(' ${m.name}$tag — $fnCount functions');
for (final imp in m.moduleImports) {
lines.add(' → ${imp.name} (${_importSource(imp)})');
}
}
return lines.join('\n');
}