From 7551c70db6c76a796e93fa1cd4ebe7c850344b7e Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 16 Dec 2007 22:24:36 +0000 Subject: restored Int size and last ; added lib/prelude to be the last in any grammar path --- src/GF/Devel/GrammarToGFCC.hs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/GF/Devel/GrammarToGFCC.hs') diff --git a/src/GF/Devel/GrammarToGFCC.hs b/src/GF/Devel/GrammarToGFCC.hs index 0ae0129ad..a61a2ec49 100644 --- a/src/GF/Devel/GrammarToGFCC.hs +++ b/src/GF/Devel/GrammarToGFCC.hs @@ -221,9 +221,11 @@ reorder abs cg = M.MGrammar $ (i,mo) <- mos, M.isModCnc mo, Just r <- [lookup i (M.allExtendSpecs cg la)]] - predefCDefs = [(IC c, CncCat (Yes GM.defLinType) Nope Nope) | - ---- lindef,printname - c <- ["Float","Int","String"]] + predefCDefs = + (IC "Int", CncCat (Yes Look.linTypeInt) Nope Nope) : + [(IC c, CncCat (Yes GM.defLinType) Nope Nope) | + ---- lindef,printname + c <- ["Float","String"]] sortIds = sortBy (\ (f,_) (g,_) -> compare f g) nubFlags = nubBy (\ (Opt (f,_)) (Opt (g,_)) -> f == g) @@ -304,7 +306,9 @@ type ParamEnv = --- gathers those param types that are actually used in lincats and lin terms paramValues :: SourceGrammar -> ParamEnv paramValues cgr = (labels,untyps,typs) where - partyps = nub $ [ty | + partyps = nub $ + [App (Q (IC "Predef") (IC "Ints")) (EInt i) | i <- [1,9]] ---linTypeInt + ++ [ty | (_,(_,CncCat (Yes (RecType ls)) _ _)) <- jments, ty0 <- [ty | (_, ty) <- unlockTyp ls], ty <- typsFrom ty0 @@ -342,7 +346,8 @@ paramValues cgr = (labels,untyps,typs) where untyps = Map.fromList $ concatMap Map.toList [typ | (_,typ) <- Map.toList typs] lincats = - [(IC cat,[(LIdent "s",GM.typeStr)]) | cat <- ["Int", "Float", "String"]] ++ + [(IC "Int",[f | let RecType fs = Look.linTypeInt, f <- fs])] ++ + [(IC cat,[(LIdent "s",GM.typeStr)]) | cat <- ["Float", "String"]] ++ reverse ---- TODO: really those lincats that are reached ---- reverse is enough to expel overshadowed ones... [(cat,(unlockTyp ls)) | (_,(cat,CncCat (Yes (RecType ls)) _ _)) <- jments] -- cgit v1.2.3