summaryrefslogtreecommitdiff
path: root/src/GF/Conversion
diff options
context:
space:
mode:
authorpeb <unknown>2005-06-23 08:43:40 +0000
committerpeb <unknown>2005-06-23 08:43:40 +0000
commit5438bcfc9a44454fbdfd55961af31f8ef4a231a5 (patch)
tree62c38e57c4ce357512a671e55f396adba57cdcfc /src/GF/Conversion
parent1f193ff830283f9630b216202bfb72acec9e7714 (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Conversion')
-rw-r--r--src/GF/Conversion/GFCtoSimple.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/GF/Conversion/GFCtoSimple.hs b/src/GF/Conversion/GFCtoSimple.hs
index 88746e65a..86a4204f0 100644
--- a/src/GF/Conversion/GFCtoSimple.hs
+++ b/src/GF/Conversion/GFCtoSimple.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/06/17 14:15:18 $
--- > CVS $Author: bringert $
--- > CVS $Revision: 1.9 $
+-- > CVS $Date: 2005/06/23 09:43:40 $
+-- > CVS $Author: peb $
+-- > CVS $Revision: 1.10 $
--
-- Converting GFC to SimpleGFC
--
@@ -27,6 +27,7 @@ import GF.Formalism.SimpleGFC
import GF.Formalism.Utilities
import GF.Conversion.Types
+import GF.UseGrammar.Linear (expandLinTables)
import GF.Canon.GFC (CanonGrammar)
import GF.Canon.MkGFC (grammar2canon)
import qualified GF.Canon.Look as Look (lookupLin, allParamValues, lookupLincat)
@@ -89,9 +90,12 @@ convertCat atom = error $ "GFCtoSimple.convertCat: " ++ show ato
convertConcrete :: Env -> Abstract SDecl Name -> Concrete SLinType (Maybe STerm)
convertConcrete gram (Abs decl args name) = Cnc ltyp largs term
- where term = fmap (convertTerm gram) $ lookupLin gram $ name2fun name
+ where term = fmap (convertTerm gram . expandTerm gram) $ lookupLin gram $ name2fun name
ltyp : largs = map (convertCType gram . lookupCType gram) (decl : args)
+expandTerm :: Env -> A.Term -> A.Term
+expandTerm gram term = err error id $ expandLinTables (fst gram) term
+
convertCType :: Env -> A.CType -> SLinType
convertCType gram (A.RecType rec) = RecT [ (lbl, convertCType gram ctype) | A.Lbg lbl ctype <- rec ]
convertCType gram (A.Table pt vt) = TblT (convertCType gram pt) (convertCType gram vt)