mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
eliminated the rest of projections with record in GFCC
This commit is contained in:
@@ -66,11 +66,11 @@ inferTerm args trm = case trm of
|
|||||||
C i -> do
|
C i -> do
|
||||||
testErr (i < length tys)
|
testErr (i < length tys)
|
||||||
("required more than " ++ show i ++ " fields in " ++ prt (R tys))
|
("required more than " ++ show i ++ " fields in " ++ prt (R tys))
|
||||||
(returnt $ tys !! i) -- record: index must be known
|
return (P t' u', tys !! i) -- record: index must be known
|
||||||
_ -> do
|
_ -> do
|
||||||
let typ = head tys
|
let typ = head tys
|
||||||
testErr (all (==typ) tys) ("different types in table " ++ prt trm)
|
testErr (all (==typ) tys) ("different types in table " ++ prt trm)
|
||||||
returnt typ -- table: must be same
|
return (P t' u', typ) -- table: types must be same
|
||||||
_ -> Bad $ "projection from " ++ prt t ++ " : " ++ prt tt
|
_ -> Bad $ "projection from " ++ prt t ++ " : " ++ prt tt
|
||||||
FV [] -> returnt str ----
|
FV [] -> returnt str ----
|
||||||
FV (t:ts) -> do
|
FV (t:ts) -> do
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ compute mcfg lang args = comp where
|
|||||||
(_, FV ts) -> FV $ Prelude.map (proj r) ts
|
(_, FV ts) -> FV $ Prelude.map (proj r) ts
|
||||||
(FV ts, _ ) -> FV $ Prelude.map (\t -> proj t r) ts
|
(FV ts, _ ) -> FV $ Prelude.map (\t -> proj t r) ts
|
||||||
(W s t, _) -> kks (s ++ getString (proj t p))
|
(W s t, _) -> kks (s ++ getString (proj t p))
|
||||||
(_,R is) -> comp $ foldl P r is
|
(_,R is) -> trace ("projection " ++ show p ++ "\n") $ comp $ foldl P r is
|
||||||
_ -> comp $ getField r (getIndex p)
|
_ -> comp $ getField r (getIndex p)
|
||||||
|
|
||||||
getString t = case t of
|
getString t = case t of
|
||||||
|
|||||||
Reference in New Issue
Block a user