mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
Started with unions.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
19
src/GF/Compile/MkUnion.hs
Normal file
19
src/GF/Compile/MkUnion.hs
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user