summaryrefslogtreecommitdiff
path: root/src/GF/Source/GrammarToSource.hs
diff options
context:
space:
mode:
authoraarne <unknown>2005-05-30 20:08:14 +0000
committeraarne <unknown>2005-05-30 20:08:14 +0000
commit3a3342a0f96ba33d0df745b87f700b9998c86f4f (patch)
tree65b80ed0a88f823ed680b76c06ad0c518f94f612 /src/GF/Source/GrammarToSource.hs
parent5bf9a7fe706e4e2d45f148dddf591c34ed1b72b3 (diff)
restricted inheritance almost implemented
Diffstat (limited to 'src/GF/Source/GrammarToSource.hs')
-rw-r--r--src/GF/Source/GrammarToSource.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/GF/Source/GrammarToSource.hs b/src/GF/Source/GrammarToSource.hs
index 8b10b7dee..ad89d5540 100644
--- a/src/GF/Source/GrammarToSource.hs
+++ b/src/GF/Source/GrammarToSource.hs
@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/05/26 14:18:17 $
+-- > CVS $Date: 2005/05/30 21:08:15 $
-- > CVS $Author: aarne $
--- > CVS $Revision: 1.21 $
+-- > CVS $Revision: 1.22 $
--
-- From internal source syntax to BNFC-generated (used for printing).
-----------------------------------------------------------------------------
@@ -45,12 +45,17 @@ trModule (i,mo) = case mo of
MTInstance a -> P.MTInstance i' (tri a)
MTInterface -> P.MTInterface i'
body = P.MBody
- (trExtend (extends m))
+ (trExtends (extend m))
(mkOpens (map trOpen (opens m)))
(mkTopDefs (concatMap trAnyDef (tree2list (jments m)) ++ map trFlag (flags m)))
-trExtend :: [Ident] -> P.Extend
-trExtend i = ifNull P.NoExt (P.Ext . map (P.IAll . tri)) i ---- IAll
+trExtends :: [(Ident,MInclude Ident)] -> P.Extend
+trExtends [] = P.NoExt
+trExtends es = (P.Ext $ map tre es) where
+ tre (i,c) = case c of
+ MIAll -> P.IAll (tri i)
+ MIOnly is -> P.ISome (tri i) (map tri is)
+ MIExcept is -> P.IMinus (tri i) (map tri is)
---- this has to be completed with other mtys
forName (MTConcrete a) = tri a