summaryrefslogtreecommitdiff
path: root/src/GF/Source
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-05-22 18:54:51 +0000
committerkrasimir <krasimir@chalmers.se>2009-05-22 18:54:51 +0000
commit41b263cf6aa38e7c6ef090c0fa18949b86eec62c (patch)
tree9e604716ed1455238c3c49cf8add777c0cdf74d4 /src/GF/Source
parent7a204376c91ea9647ec4418cfcd3ed0dd7891fae (diff)
some work on evaluation with abstract expressions in PGF
Diffstat (limited to 'src/GF/Source')
-rw-r--r--src/GF/Source/CF.hs2
-rw-r--r--src/GF/Source/GrammarToSource.hs6
-rw-r--r--src/GF/Source/SourceToGrammar.hs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/GF/Source/CF.hs b/src/GF/Source/CF.hs
index b142fd670..a25baddc1 100644
--- a/src/GF/Source/CF.hs
+++ b/src/GF/Source/CF.hs
@@ -105,7 +105,7 @@ cf2cat (_,(cat, items)) = map identS $ cat : [c | Left c <- items]
cf2rule :: CFRule -> ((Ident,Info),(Ident,Info))
cf2rule (fun, (cat, items)) = (def,ldef) where
f = identS fun
- def = (f, AbsFun (Just (mkProd (args', Cn (identS cat), []))) Nothing)
+ def = (f, AbsFun (Just (mkProd (args', Cn (identS cat), []))) Nothing Nothing)
args0 = zip (map (identS . ("x" ++) . show) [0..]) items
args = [(v, Cn (identS c)) | (v, Left c) <- args0]
args' = [(identS "_", Cn (identS c)) | (_, Left c) <- args0]
diff --git a/src/GF/Source/GrammarToSource.hs b/src/GF/Source/GrammarToSource.hs
index cff23f426..a3754336e 100644
--- a/src/GF/Source/GrammarToSource.hs
+++ b/src/GF/Source/GrammarToSource.hs
@@ -75,9 +75,9 @@ mkTopDefs ds = ds
trAnyDef :: (Ident,Info) -> [P.TopDef]
trAnyDef (i,info) = let i' = tri i in case info of
AbsCat (Just co) pd -> [P.DefCat [P.SimpleCatDef i' (map trDecl co)]]
- AbsFun (Just ty) Nothing -> [P.DefFunData [P.FunDef [i'] (trt ty)]]
- AbsFun (Just ty) (Just eqs) -> [P.DefFun [P.FunDef [i'] (trt ty)]] ++
- [P.DefDef [P.DPatt (mkName i') (map trp patts) (trt res)] | (patts,res) <- eqs]
+ AbsFun (Just ty) _ Nothing -> [P.DefFunData [P.FunDef [i'] (trt ty)]]
+ AbsFun (Just ty) _ (Just eqs) -> [P.DefFun [P.FunDef [i'] (trt ty)]] ++
+ [P.DefDef [P.DPatt (mkName i') (map trp patts) (trt res)] | (patts,res) <- eqs]
ResOper pty ptr -> [P.DefOper [trDef i' pty ptr]]
ResParam pp -> [P.DefPar [case pp of
diff --git a/src/GF/Source/SourceToGrammar.hs b/src/GF/Source/SourceToGrammar.hs
index 67de8fd46..fc7c2b285 100644
--- a/src/GF/Source/SourceToGrammar.hs
+++ b/src/GF/Source/SourceToGrammar.hs
@@ -585,7 +585,7 @@ transPatts p = case p of
transPatt :: Patt -> Err G.Patt
transPatt x = case x of
- PW -> return G.wildPatt
+ PW -> return G.PW
PV id -> liftM G.PV $ transIdent id
PC id patts -> liftM2 G.PC (transIdent id) (mapM transPatt patts)
PCon id -> liftM2 G.PC (transIdent id) (return [])