1
0
forked from GitHub/gf-core

Added | syntax for variants.

This commit is contained in:
bjorn
2008-10-03 07:35:26 +00:00
parent 6d4d6bce68
commit 4b41039a5d
6 changed files with 279 additions and 259 deletions

View File

@@ -501,6 +501,11 @@ transExp x = case x of
ECTable binds exp -> liftM2 M.mkCTable (mapM transBind binds) (transExp exp)
EVariants exps -> liftM G.FV $ mapM transExp exps
EVariant exp0 exp -> do let fvList (G.FV xs) = xs
fvList t = [t]
exp0' <- transExp exp0
exp' <- transExp exp
return $ G.FV $ fvList exp0' ++ fvList exp'
EPre exp alts -> liftM2 (curry G.Alts) (transExp exp) (mapM transAltern alts)
EStrs exps -> liftM G.Strs $ mapM transExp exps
ESelect exp0 exp -> liftM2 G.S (transExp exp0) (transExp exp)