summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authoraarne <unknown>2004-02-27 07:43:52 +0000
committeraarne <unknown>2004-02-27 07:43:52 +0000
commit0166b27ee45f24fb60d79498a5d15b4f316191f3 (patch)
tree72a5c1aa21ee0856ce1a621d094471d056040385 /src/GF/Compile
parent2e1b57878329eb6a1822ef43c190f8a2aaaa82b7 (diff)
Started with unions.
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/Compile.hs4
-rw-r--r--src/GF/Compile/GetGrammar.hs2
-rw-r--r--src/GF/Compile/MkUnion.hs19
3 files changed, 24 insertions, 1 deletions
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index 77d9db11c..9d80f6a05 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -10,6 +10,7 @@ import Modules
import ReadFiles
import ShellState
import MkResource
+import MkUnion
-- the main compiler passes
import GetGrammar
@@ -177,6 +178,9 @@ makeSourceModule opts env@(k,gr,can) mo@(i,mi) = case mi of
mos = modules gr
--- putp " type checking reused" $ ioeErr $ showCheckModule mos mo2
return $ (k,mo2)
+ MTUnion ty imps -> do
+ mo' <- ioeErr $ makeUnion gr i ty imps
+ compileSourceModule opts env mo'
_ -> compileSourceModule opts env mo
_ -> compileSourceModule opts env mo
where
diff --git a/src/GF/Compile/GetGrammar.hs b/src/GF/Compile/GetGrammar.hs
index ef9e0944f..3b9acd9d6 100644
--- a/src/GF/Compile/GetGrammar.hs
+++ b/src/GF/Compile/GetGrammar.hs
@@ -79,5 +79,5 @@ oldLexer = map change . L.tokens where
(L.PT p (L.TS s)) | elem s new -> (L.PT p (L.TV (init s ++ "Z")))
_ -> t
new = words $ "abstract concrete interface incomplete " ++
- "instance out open resource reuse transfer with where"
+ "instance out open resource reuse transfer union with where"
diff --git a/src/GF/Compile/MkUnion.hs b/src/GF/Compile/MkUnion.hs
new file mode 100644
index 000000000..f612b92b6
--- /dev/null
+++ b/src/GF/Compile/MkUnion.hs
@@ -0,0 +1,19 @@
+module MkUnion (makeUnion) where
+
+import Grammar
+import Ident
+import Modules
+import Macros
+import PrGrammar
+
+import Operations
+
+import Monad
+
+-- building union of modules
+-- AR 21/8/2002 -- 22/6/2003 for GF with modules
+
+makeUnion :: SourceGrammar -> Ident -> ModuleType Ident -> [(Ident,[Ident])] ->
+ Err SourceModule
+makeUnion gr m ty imps = do
+ Bad "Sorry: unions not yet implemented"