Skip to content

Commit

Permalink
update cntlines.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Dec 15, 2023
1 parent e099dc9 commit 6b8879d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cntlines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ function count() {
cloc $1 | grep 'SUM:' | awk '{print $5}'
}

function count_pir () {
find $1 -name '*.pir' -print | xargs sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
function count_ext () {
find $2 -name $1 -print | xargs sed '/^[[:space:]]*$/d' | wc -l | tr -d ' '
}

RUNTIME_C=$(count runtime/src/juvix)
RUNTIME_VAMPIR=$(count_pir runtime/src/vampir)
RUNTIME_VAMPIR=$(count_ext '*.pir' runtime/src/vampir)
RUNTIME_JVA=$(count_ext '*.jva' runtime/src/asm)

RUNTIME=$((RUNTIME_C+RUNTIME_VAMPIR))
RUNTIME=$((RUNTIME_C+RUNTIME_VAMPIR+RUNTIME_JVA))

BACKENDC=$(count src/Juvix/Compiler/Backend/C/)
GEB=$(count src/Juvix/Compiler/Backend/Geb/)
Expand Down Expand Up @@ -52,6 +53,7 @@ echo " JuvixAsm: $ASM LOC"
echo " JuvixCore: $CORE LOC"
echo "Runtime: $RUNTIME LOC"
echo " C runtime: $RUNTIME_C LOC"
echo " JuvixAsm runtime: $RUNTIME_JVA LOC"
echo " VampIR runtime: $RUNTIME_VAMPIR LOC"
echo "Other: $OTHER LOC"
echo " Application: $APP LOC"
Expand All @@ -61,4 +63,4 @@ echo " Data: $DATA LOC"
echo " Prelude: $PRELUDE LOC"
echo "Tests: $TESTS LOC"
echo ""
echo "Total: $TOTAL Haskell LOC + $RUNTIME_C C LOC + $RUNTIME_VAMPIR VampIR LOC"
echo "Total: $TOTAL Haskell LOC + $RUNTIME_C C LOC + $RUNTIME_JVA JuvixAsm LOC + $RUNTIME_VAMPIR VampIR LOC"

0 comments on commit 6b8879d

Please sign in to comment.