From f09e929dd1e46c066a566a5e0c6437ecaf3002a1 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 6 Jun 2006 21:30:14 +0000 Subject: initial support for literal categories e.g. String,Int and Float --- src/GF/Conversion/SimpleToFCFG.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/GF/Conversion/SimpleToFCFG.hs') diff --git a/src/GF/Conversion/SimpleToFCFG.hs b/src/GF/Conversion/SimpleToFCFG.hs index 7570f2d65..b1093e9f2 100644 --- a/src/GF/Conversion/SimpleToFCFG.hs +++ b/src/GF/Conversion/SimpleToFCFG.hs @@ -244,7 +244,14 @@ type SRulesMap = Map.Map SCat [SRule] type FCatSet = Map.Map SCat (Map.Map [SPath] (Map.Map [(SPath,STerm)] (Either FCat FCat))) -emptyFRulesEnv = FRulesEnv 0 Map.empty [] +emptyFRulesEnv = FRulesEnv 0 (ins fcatString (ins fcatInt (ins fcatFloat Map.empty))) [] + where + ins fcat@(FCat _ cat rcs tcs) fcatSet = + Map.insertWith (\_ -> Map.insertWith (\_ -> Map.insert tcs x_fcat) rcs tmap_s) cat rmap_s fcatSet + where + x_fcat = Right fcat + tmap_s = Map.singleton tcs x_fcat + rmap_s = Map.singleton rcs tmap_s genFCatHead :: FRulesEnv -> FCat -> (FRulesEnv, FCat) genFCatHead env@(FRulesEnv last_id fcatSet rules) m1@(FCat _ cat rcs tcs) = -- cgit v1.2.3