-
Notifications
You must be signed in to change notification settings - Fork 5
/
statistics
executable file
·43 lines (32 loc) · 901 Bytes
/
statistics
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/bash
rkt_files () {
find *.rkt private/*/*.rkt
}
tst_files () {
find {examples,tests}/*.rkt
}
code=`rkt_files | xargs egrep -v -e '^ *$' -e '^ *;' | wc -l`
echo $code" code lines"
defs=`rkt_files | xargs egrep -e '^\(define' | wc -l`
echo $defs" definitions"
tests=`tst_files | xargs egrep -v -e '^ *$' -e '^ *;' | wc -l`
echo $tests" test lines"
comm=`rkt_files | xargs egrep '^ *;' | wc -l`
echo $comm" comment lines"
docs=`egrep -v -e '^ *$' doc/eng/*.scrbl | wc -l`
echo $docs" documentation lines"
words () {
rkt_files |
xargs egrep -h -v -e '^ *$' -e '^ *;' |
egrep -o '\b[-+/*?<>=a-z]+\b' |
egrep -v 'racket/' |
sort -u | wc -l
}
def_words () {
rkt_files |
xargs egrep -h -v -e '^ *$' -e '^ *;' |
egrep '^\(def' |
sed -r -e 's/\(def[^ ]+ \(([^)]+)\).*/\1/' -e 's/\(def[^ ]+ ([^ ]+).*/\1/'
}
#echo `words`
#echo `def_words` | egrep -o '[^ ]+' | sort -u | wc -l