summaryrefslogtreecommitdiff
path: root/src/GF/Canon/GFCC/CheckGFCC.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-04 08:23:56 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-04 08:23:56 +0000
commite697fa5c3982681512f43589aa96d18a17cad82e (patch)
tree258b82a6459ea7567c6589796f1b1ac3850de157 /src/GF/Canon/GFCC/CheckGFCC.hs
parent70c8cff0f915d241d5c4e3465b5d1238ee714357 (diff)
eliminated the rest of projections with record in GFCC
Diffstat (limited to 'src/GF/Canon/GFCC/CheckGFCC.hs')
-rw-r--r--src/GF/Canon/GFCC/CheckGFCC.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/GF/Canon/GFCC/CheckGFCC.hs b/src/GF/Canon/GFCC/CheckGFCC.hs
index 05f591627..7de57cd5b 100644
--- a/src/GF/Canon/GFCC/CheckGFCC.hs
+++ b/src/GF/Canon/GFCC/CheckGFCC.hs
@@ -58,20 +58,20 @@ inferTerm args trm = case trm of
(t',tt) <- infer t
(u',tu) <- infer u
case tt of
- R tys -> case tu of
- R vs -> infer $ foldl P t' [P u' (C i) | i <- [0 .. length vs - 1]]
- --- R [v] -> infer $ P t v
- --- R (v:vs) -> infer $ P (head tys) (R vs)
+ R tys -> case tu of
+ R vs -> infer $ foldl P t' [P u' (C i) | i <- [0 .. length vs - 1]]
+ --- R [v] -> infer $ P t v
+ --- R (v:vs) -> infer $ P (head tys) (R vs)
- C i -> do
- testErr (i < length tys)
- ("required more than " ++ show i ++ " fields in " ++ prt (R tys))
- (returnt $ tys !! i) -- record: index must be known
- _ -> do
- let typ = head tys
- testErr (all (==typ) tys) ("different types in table " ++ prt trm)
- returnt typ -- table: must be same
- _ -> Bad $ "projection from " ++ prt t ++ " : " ++ prt tt
+ C i -> do
+ testErr (i < length tys)
+ ("required more than " ++ show i ++ " fields in " ++ prt (R tys))
+ return (P t' u', tys !! i) -- record: index must be known
+ _ -> do
+ let typ = head tys
+ testErr (all (==typ) tys) ("different types in table " ++ prt trm)
+ return (P t' u', typ) -- table: types must be same
+ _ -> Bad $ "projection from " ++ prt t ++ " : " ++ prt tt
FV [] -> returnt str ----
FV (t:ts) -> do
(t',ty) <- infer t