summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-11-06 14:29:17 +0000
committerhallgren <hallgren@chalmers.se>2013-11-06 14:29:17 +0000
commit48660c219a29eb0ef7d18839f0e117c3cab656cf (patch)
tree36fbad6bcb7623b6f70775fe855d47fe76f0f3b7 /src/compiler/GF/Command
parent7a41b45f13e52c6141b1144c32d3f94a3346032f (diff)
Make PGF.Tree internal
The only use of PGF.Tree outside the PGF library was in GF.Command.Commands, and it was eliminated by using PGF.Expr directly instead. PGF.Paraphrase still uses PGF.Tree.
Diffstat (limited to 'src/compiler/GF/Command')
-rw-r--r--src/compiler/GF/Command/Commands.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 58e485768..be309b3d7 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -20,7 +20,7 @@ import PGF.Data(abstract,funs,cats,Literal(LStr),Expr(EFun,ELit)) ----
import PGF.Printer(ppFun,ppCat)
--import PGF.Probabilistic(rankTreesByProbs,probTree,setProbabilities)
--import PGF.Generate (generateRandomFrom) ----
-import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
+--import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
import PGF.Optimize(optimizePGF)
import GF.Compile.Export
@@ -1198,10 +1198,9 @@ allCommands = Map.fromList [
_ -> unl . linearize pgf lang
-- replace each non-atomic constructor with mkC, where C is the val cat
- tree2mk pgf = showExpr [] . tree2expr . t2m . expr2tree where
- t2m t = case t of
- Fun cid [] -> t
- Fun cid ts -> Fun (mk cid) (map t2m ts)
+ tree2mk pgf = showExpr [] . t2m where
+ t2m t = case unApp t of
+ Just (cid,ts@(_:_)) -> mkApp (mk cid) (map t2m ts)
_ -> t
mk = mkCId . ("mk" ++) . showCId . lookValCat (abstract pgf)