diff options
Diffstat (limited to 'src/GF/Source')
| -rw-r--r-- | src/GF/Source/GrammarToSource.hs | 4 | ||||
| -rw-r--r-- | src/GF/Source/SourceToGrammar.hs | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/GF/Source/GrammarToSource.hs b/src/GF/Source/GrammarToSource.hs index b313b563c..290cb92d0 100644 --- a/src/GF/Source/GrammarToSource.hs +++ b/src/GF/Source/GrammarToSource.hs @@ -30,8 +30,8 @@ trModule (i,mo) = case mo of (mkOpens (map trOpen (opens m))) (mkTopDefs (concatMap trAnyDef (tree2list (jments m)) ++ map trFlag (flags m))) -trExtend :: Maybe Ident -> P.Extend -trExtend i = maybe P.NoExt (P.Ext . singleton . tri) i +trExtend :: [Ident] -> P.Extend +trExtend i = ifNull P.NoExt (P.Ext . map tri) i ---- this has to be completed with other mtys forName (MTConcrete a) = tri a diff --git a/src/GF/Source/SourceToGrammar.hs b/src/GF/Source/SourceToGrammar.hs index 31e917469..436ce4503 100644 --- a/src/GF/Source/SourceToGrammar.hs +++ b/src/GF/Source/SourceToGrammar.hs @@ -75,11 +75,11 @@ transModDef x = case x of flags' <- return [f | Right fs <- defs0, f <- fs] return (id',GM.ModMod (GM.Module mtyp' mstat' flags' extends' opens' defs')) MReuse _ -> do - return (id', GM.ModMod (GM.Module mtyp' mstat' [] Nothing [] NT)) + return (id', GM.ModMod (GM.Module mtyp' mstat' [] [] [] NT)) MUnion imps -> do imps' <- mapM transIncluded imps return (id', - GM.ModMod (GM.Module (GM.MTUnion mtyp' imps') mstat' [] Nothing [] NT)) + GM.ModMod (GM.Module (GM.MTUnion mtyp' imps') mstat' [] [] [] NT)) MWith m opens -> do m' <- transIdent m @@ -137,11 +137,10 @@ transTransfer x = case x of TransferIn open -> liftM Left $ transOpen open TransferOut open -> liftM Right $ transOpen open -transExtend :: Extend -> Err (Maybe Ident) +transExtend :: Extend -> Err [Ident] transExtend x = case x of - Ext [id] -> transIdent id >>= return . Just - Ext ids -> Bad "sorry, no support for multiple inheritance yet" - NoExt -> return Nothing + Ext ids -> mapM transIdent ids + NoExt -> return [] transOpens :: Opens -> Err [GM.OpenSpec Ident] transOpens x = case x of |
