diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-02-01 22:01:10 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-02-01 22:01:10 +0000 |
| commit | 48895581378353743e51bae6cbbe60bf31b7b8e3 (patch) | |
| tree | 91ffacfa4b95a59e216d32cf69673256b9370415 /src/GF/Devel/Compile/SourceToGF.hs | |
| parent | 3addf256bcfaaa7748b0159a3dd6f6ce8fcd8b7c (diff) | |
added some new pattern forms, incl. pattern macros, to testgf3
Diffstat (limited to 'src/GF/Devel/Compile/SourceToGF.hs')
| -rw-r--r-- | src/GF/Devel/Compile/SourceToGF.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/GF/Devel/Compile/SourceToGF.hs b/src/GF/Devel/Compile/SourceToGF.hs index 5e7d8dc9e..f501fd609 100644 --- a/src/GF/Devel/Compile/SourceToGF.hs +++ b/src/GF/Devel/Compile/SourceToGF.hs @@ -393,10 +393,10 @@ transExp x = case x of ETupTyp x y -> tups x ++ [y] -- right-associative parsing _ -> [t] es <- mapM transExp $ tups x - return $ G.RecType $ [] ---- M.tuple2recordType es + return $ G.RecType $ M.tuple2recordType es ETuple tuplecomps -> do es <- mapM transExp [e | TComp e <- tuplecomps] - return $ G.R $ [] ---- M.tuple2record es + return $ G.R $ M.tuple2record es EProj exp id -> liftM2 G.P (transExp exp) (trLabel id) EApp exp0 exp -> liftM2 G.App (transExp exp0) (transExp exp) ETable cases -> liftM (G.T G.TRaw) (transCases cases) @@ -437,6 +437,9 @@ transExp x = case x of ELetb defs exp -> transExp $ ELet defs exp EWhere exp defs -> transExp $ ELet defs exp + EPattType typ -> liftM G.EPattType (transExp typ) + EPatt patt -> liftM G.EPatt (transPatt patt) + ELString (LString str) -> return $ G.K str ---- ELin id -> liftM G.LiT $ transIdent id @@ -503,6 +506,10 @@ transSort x = case x of transPatt :: Patt -> Err G.Patt transPatt x = case x of + PChar -> return G.PChar + PChars s -> return $ G.PChars s + PMacro c -> liftM G.PMacro $ transIdent c + PM m c -> liftM2 G.PM (transIdent m) (transIdent c) PW -> return wildPatt PV (PIdent (_,"_")) -> return wildPatt PV id -> liftM G.PV $ transIdent id |
