summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-05 07:05:41 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-05 07:05:41 +0000
commit3ed19a482e796b0a62d234ec9ffd1981d5fee64e (patch)
tree93e3cf1a0643480f704bd5243585a090678b04b2 /src/compiler/GF/Compile
parent354269e17c63d6e750fb5626adac43b92479506a (diff)
printnames are now kept as String instead of Term in PGF
Diffstat (limited to 'src/compiler/GF/Compile')
-rw-r--r--src/compiler/GF/Compile/GrammarToPGF.hs5
-rw-r--r--src/compiler/GF/Compile/OptimizePGF.hs7
2 files changed, 5 insertions, 7 deletions
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs
index 2a4085cc3..0e58398d6 100644
--- a/src/compiler/GF/Compile/GrammarToPGF.hs
+++ b/src/compiler/GF/Compile/GrammarToPGF.hs
@@ -5,6 +5,7 @@ import GF.Compile.Export
import GF.Compile.GeneratePMCFG
import PGF.CId
+import PGF.Linearize(realize)
import qualified PGF.Macros as CM
import qualified PGF.Data as C
import qualified PGF.Data as D
@@ -102,8 +103,8 @@ canon2gfcc opts pars cgr@(M.MGrammar ((a,abm):cms)) =
lindefs = Map.fromAscList
[(i2i c, umkTerm tr) | (c,CncCat _ (Just tr) _) <- js]
printnames = Map.union
- (Map.fromAscList [(i2i f, umkTerm tr) | (f,CncFun _ _ (Just tr)) <- js])
- (Map.fromAscList [(i2i f, umkTerm tr) | (f,CncCat _ _ (Just tr)) <- js])
+ (Map.fromAscList [(i2i f, realize (umkTerm tr)) | (f,CncFun _ _ (Just tr)) <- js])
+ (Map.fromAscList [(i2i f, realize (umkTerm tr)) | (f,CncCat _ _ (Just tr)) <- js])
params = Map.fromAscList
[(i2i c, pars lang0 c) | (c,CncCat (Just ty) _ _) <- js]
fcfg = Nothing
diff --git a/src/compiler/GF/Compile/OptimizePGF.hs b/src/compiler/GF/Compile/OptimizePGF.hs
index b23560437..4ef8ce5cf 100644
--- a/src/compiler/GF/Compile/OptimizePGF.hs
+++ b/src/compiler/GF/Compile/OptimizePGF.hs
@@ -21,8 +21,7 @@ suffixOptimize = mapConcretes opt
where
opt cnc = cnc {
lins = Map.map optTerm (lins cnc),
- lindefs = Map.map optTerm (lindefs cnc),
- printnames = Map.map optTerm (printnames cnc)
+ lindefs = Map.map optTerm (lindefs cnc)
}
cseOptimize :: PGF -> PGF
@@ -66,8 +65,7 @@ addSubexpConsts :: TermList -> Concr -> Concr
addSubexpConsts tree cnc = cnc {
opers = Map.fromList [(f,recomp f trm) | (f,trm) <- ops],
lins = rec lins,
- lindefs = rec lindefs,
- printnames = rec printnames
+ lindefs = rec lindefs
}
where
ops = [(fid id, trm) | (trm,(_,id)) <- Map.assocs tree]
@@ -88,7 +86,6 @@ getSubtermsMod :: Concr -> TermM TermList
getSubtermsMod cnc = do
mapM getSubterms (Map.assocs (lins cnc))
mapM getSubterms (Map.assocs (lindefs cnc))
- mapM getSubterms (Map.assocs (printnames cnc))
(tree0,_) <- readSTM
return $ Map.filter (\ (nu,_) -> nu > 1) tree0
where