diff options
| author | aarne <unknown> | 2004-09-24 08:46:03 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-09-24 08:46:03 +0000 |
| commit | 33ea630d4d431045c13e96c51e953ce0bafb4f0f (patch) | |
| tree | fbac8eb1c4b9c2344e4ddfcd8a281e859aaf7f42 /src/GF/Compile | |
| parent | 2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 (diff) | |
bug fixes in parsing etc; improved ImperC
Diffstat (limited to 'src/GF/Compile')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 5 | ||||
| -rw-r--r-- | src/GF/Compile/Optimize.hs | 1 | ||||
| -rw-r--r-- | src/GF/Compile/Rename.hs | 1 |
3 files changed, 7 insertions, 0 deletions
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 |
