From 33ea630d4d431045c13e96c51e953ce0bafb4f0f Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 24 Sep 2004 08:46:03 +0000 Subject: bug fixes in parsing etc; improved ImperC --- src/GF/Compile/CheckGrammar.hs | 5 +++++ src/GF/Compile/Optimize.hs | 1 + src/GF/Compile/Rename.hs | 1 + 3 files changed, 7 insertions(+) (limited to 'src/GF/Compile') diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 8f152ff17..74256d66b 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -309,6 +309,11 @@ inferLType gr trm = case trm of Vr ident -> termWith trm $ checkLookup ident + Typed e t -> do + t' <- comp t + check e t' + return (e,t') + App f a -> do (f',fty) <- infer f fty' <- comp fty diff --git a/src/GF/Compile/Optimize.hs b/src/GF/Compile/Optimize.hs index bb54df050..61ff8de32 100644 --- a/src/GF/Compile/Optimize.hs +++ b/src/GF/Compile/Optimize.hs @@ -166,6 +166,7 @@ mkLinDefault gr typ = do let (ls,ts) = unzip r ts' <- mapM mkDefField ts return $ R $ [assign l t | (l,t) <- zip ls ts'] + _ | isTypeInts typ -> return $ EInt 0 -- exists in all as first val _ -> prtBad "linearization type field cannot be" typ -- Form the printname: if given, compute. If not, use the computed diff --git a/src/GF/Compile/Rename.hs b/src/GF/Compile/Rename.hs index 6c3f964df..55708f629 100644 --- a/src/GF/Compile/Rename.hs +++ b/src/GF/Compile/Rename.hs @@ -158,6 +158,7 @@ renameTerm env vars = ren vars where ren vs trm = case trm of Abs x b -> liftM (Abs x) (ren (x:vs) b) Prod x a b -> liftM2 (Prod x) (ren vs a) (ren (x:vs) b) + Typed a b -> liftM2 Typed (ren vs a) (ren vs b) Vr x | elem x vs -> return trm | otherwise -> renid trm -- cgit v1.2.3