summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-09-25 08:43:23 +0000
committeraarne <aarne@chalmers.se>2011-09-25 08:43:23 +0000
commit1a3a26563b502395702704824e74929f53696348 (patch)
treea601a7e926572a6ef92c7463680028ea03d8e870 /src
parent0c2f20d04d2a8da118182eab259a0111d02ec57d (diff)
generalized show_dependencies to take a list of constants as its argument
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GFI.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs
index 77f534d46..d27a0b497 100644
--- a/src/compiler/GFI.hs
+++ b/src/compiler/GFI.hs
@@ -35,7 +35,7 @@ import PGF.Macros
import Data.Char
import Data.Maybe
-import Data.List(isPrefixOf,isInfixOf,partition)
+import Data.List(nub,isPrefixOf,isInfixOf,partition)
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as BS
import qualified Text.ParserCombinators.ReadP as RP
@@ -187,12 +187,12 @@ execute1 opts gfenv0 s0 =
continue gfenv
show_deps ws = do
- let (os,ts) = partition (isPrefixOf "-") ws
- ops <- case ts of
+ let (os,xs) = partition (isPrefixOf "-") ws
+ ops <- case xs of
_:_ -> do
- let Right t = runP pExp (encodeUnicode utf8 (unwords ts))
- err error (return . (t:)) $ constantDepsTerm sgr t
- _ -> error "give a term as argument"
+ let ts = [t | Right t <- map (runP pExp . encodeUnicode utf8) xs]
+ err error (return . nub . (ts ++) . concat) $ mapM (constantDepsTerm sgr) ts
+ _ -> error "expected one or more qualified constants as argument"
let prTerm = showTerm sgr TermPrintDefault Qualified
let size = sizeConstant sgr
let printed