summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-09-22 07:40:19 +0000
committeraarne <aarne@chalmers.se>2011-09-22 07:40:19 +0000
commitbaa9bcd9d072277261d0bf85c9623a0db9e8f9d6 (patch)
treedfecc320786f9c0700f85d995ddeec251e406d25 /src/compiler/GF/Grammar
parentea04171fc6dfd0c38b69da02b60b0361487d7e5c (diff)
documented the ss command
Diffstat (limited to 'src/compiler/GF/Grammar')
-rw-r--r--src/compiler/GF/Grammar/Analyse.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/GF/Grammar/Analyse.hs b/src/compiler/GF/Grammar/Analyse.hs
index b8c9f5042..8d41d1713 100644
--- a/src/compiler/GF/Grammar/Analyse.hs
+++ b/src/compiler/GF/Grammar/Analyse.hs
@@ -106,7 +106,7 @@ sizeInfo i = case i of
ResOverload is fs -> 1 + sum [sizeTerm ty + sizeTerm tr | (L _ ty, L _ tr) <- fs]
CncCat mty mte mtf -> 1 + msize mty -- ignoring lindef and printname
CncFun mict mte mtf -> 1 + msize mte -- ignoring type and printname
- AnyInd b f -> 0
+ AnyInd b f -> -1 -- just to ignore these in the size
_ -> 0
where
msize mt = case mt of
@@ -121,7 +121,7 @@ sizesModule :: SourceModule -> (Int, [(Ident,Int)])
sizesModule (_,m) =
let
js = Map.toList (jments m)
- tb = [(i,sizeInfo j) | (i,j) <- js]
+ tb = [(i,k) | (i,j) <- js, let k = sizeInfo j, k >= 0]
in (length tb + sum (map snd tb),tb)
-- the size of a grammar