| 70 | # the formats |
| 71 | |
| 72 | def fmt_summary(analysis): |
| 73 | # XXX Support sorting and grouping. |
| 74 | supported = [] |
| 75 | unsupported = [] |
| 76 | for item in analysis: |
| 77 | if item.supported: |
| 78 | supported.append(item) |
| 79 | else: |
| 80 | unsupported.append(item) |
| 81 | total = 0 |
| 82 | |
| 83 | def section(name, groupitems): |
| 84 | nonlocal total |
| 85 | items, render = c_analyzer.build_section(name, groupitems, |
| 86 | relroot=REPO_ROOT) |
| 87 | yield from render() |
| 88 | total += len(items) |
| 89 | |
| 90 | yield '' |
| 91 | yield '====================' |
| 92 | yield 'supported' |
| 93 | yield '====================' |
| 94 | |
| 95 | yield from section('types', supported) |
| 96 | yield from section('variables', supported) |
| 97 | |
| 98 | yield '' |
| 99 | yield '====================' |
| 100 | yield 'unsupported' |
| 101 | yield '====================' |
| 102 | |
| 103 | yield from section('types', unsupported) |
| 104 | yield from section('variables', unsupported) |
| 105 | |
| 106 | yield '' |
| 107 | yield f'grand total: {total}' |
| 108 | |
| 109 | |
| 110 | ####################################### |