Files
newt/scripts/stats.py
Steve Dunham a40956a4cc
Some checks failed
Publish Playground / build (push) Has been cancelled
Publish Playground / deploy (push) Has been cancelled
fix names growing in liftWhere and redundant error for ErrorHole
2026-03-21 20:45:28 -07:00

19 lines
425 B
Python
Executable File

#!/usr/bin/env python3
import sys
fn = sys.argv[1]
stats = {}
acc = ''
name = ''
for line in open(fn):
if line.startswith('const') or line.startswith('let'):
if name: stats[name] = len(acc)
acc = line
name = line.split()[1]
else:
acc += line
if name: stats[name] = len(acc)
sorted_stats = sorted(((v, k) for k, v in stats.items()))
for value, key in sorted_stats:
print(value, key)