From 1e8699d159dc510c300a5657e1127400030a1c10 Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 3 Oct 2008 07:35:26 +0000 Subject: Added | syntax for variants. --- src/GF/Source/SourceToGrammar.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/GF/Source/SourceToGrammar.hs') diff --git a/src/GF/Source/SourceToGrammar.hs b/src/GF/Source/SourceToGrammar.hs index e80219f30..9c67f5c19 100644 --- a/src/GF/Source/SourceToGrammar.hs +++ b/src/GF/Source/SourceToGrammar.hs @@ -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) -- cgit v1.2.3