mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
bug fixes in parsing etc; improved ImperC
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user