diff options
| author | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-05-20 21:03:56 +0000 |
| commit | 7db4b641ce6abe90dd404459cd5eccb6e67f618c (patch) | |
| tree | f708d2e7ed970d71655b66cac78c8b525b010cd9 /src/GF/Compile/CheckGrammar.hs | |
| parent | 401dfc28d62584178c1187c92dece8dd0832dcb4 (diff) | |
refactor the PGF.Expr type and the evaluation of abstract expressions
Diffstat (limited to 'src/GF/Compile/CheckGrammar.hs')
| -rw-r--r-- | src/GF/Compile/CheckGrammar.hs | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 9947de64f..59961e0cd 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -124,16 +124,14 @@ checkAbsInfo st m mo (c,info) = do AbsCat (Just cont) _ -> mkCheck "category" $ checkContext st cont ---- also cstrs AbsFun (Just typ0) md -> do - typ <- compAbsTyp [] typ0 -- to calculate let definitions - mkCheck "type of function" $ checkTyp st typ - md' <- case md of - Just d -> do - let d' = elimTables d ----- mkCheckWarn "definition of function" $ checkEquation st (m,c) d' - mkCheck "definition of function" $ checkEquation st (m,c) d' - return $ Just d' - _ -> return md - return $ (c,AbsFun (Just typ) md') + typ <- compAbsTyp [] typ0 -- to calculate let definitions + mkCheck "type of function" $ + checkTyp st typ + case md of + Just eqs -> mkCheck "definition of function" $ + checkDef st (m,c) typ eqs + Nothing -> return (c,info) + return $ (c,AbsFun (Just typ) md) _ -> return (c,info) where mkCheck cat ss = case ss of @@ -161,17 +159,6 @@ checkAbsInfo st m mo (c,info) = do Abs _ _ -> return t _ -> composOp (compAbsTyp g) t - elimTables e = case e of - S t a -> elimSel (elimTables t) (elimTables a) - T _ cs -> Eqs [(elimPatt p, elimTables t) | (p,t) <- cs] - _ -> composSafeOp elimTables e - elimPatt p = case p of - PR lps -> map snd lps - _ -> [p] - elimSel t a = case a of - R fs -> mkApp t (map (snd . snd) fs) - _ -> mkApp t [a] - checkCompleteGrammar :: SourceGrammar -> SourceModInfo -> SourceModInfo -> Check (BinTree Ident Info) checkCompleteGrammar gr abs cnc = do let jsa = jments abs |
