diff options
| author | aarne <aarne@chalmers.se> | 2011-09-26 13:56:39 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2011-09-26 13:56:39 +0000 |
| commit | a83b6bea626c0f42879af662b90c587d56eb5df0 (patch) | |
| tree | b9e81960537a3b05d6d29d5523b71b6d7860e62c /src/compiler | |
| parent | ff4929e25e49e771dd0355dd7f8809161f69e008 (diff) | |
don't count app nodes in term size
Diffstat (limited to 'src/compiler')
| -rw-r--r-- | src/compiler/GF/Grammar/Analyse.hs | 2 | ||||
| -rw-r--r-- | src/compiler/GFI.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/GF/Grammar/Analyse.hs b/src/compiler/GF/Grammar/Analyse.hs index b7809309b..981037827 100644 --- a/src/compiler/GF/Grammar/Analyse.hs +++ b/src/compiler/GF/Grammar/Analyse.hs @@ -80,7 +80,7 @@ sizeConstant sgr t = err (const 0) id $ do -- ground terms count as 1, i.e. as "one work" each sizeTerm :: Term -> Int sizeTerm t = case t of - App c a -> 1 + sizeTerm c + sizeTerm a + App c a -> sizeTerm c + sizeTerm a -- app nodes don't count Abs _ _ b -> 2 + sizeTerm b Prod _ _ a b -> 2 + sizeTerm a + sizeTerm b S c a -> 1 + sizeTerm c + sizeTerm a diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs index d27a0b497..7017c920e 100644 --- a/src/compiler/GFI.hs +++ b/src/compiler/GFI.hs @@ -191,7 +191,7 @@ execute1 opts gfenv0 s0 = ops <- case xs of _:_ -> do let ts = [t | Right t <- map (runP pExp . encodeUnicode utf8) xs] - err error (return . nub . (ts ++) . concat) $ mapM (constantDepsTerm sgr) ts + err error (return . nub . concat) $ mapM (constantDepsTerm sgr) ts _ -> error "expected one or more qualified constants as argument" let prTerm = showTerm sgr TermPrintDefault Qualified let size = sizeConstant sgr |
