diff options
| author | krasimir <krasimir@chalmers.se> | 2009-01-19 13:23:03 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-01-19 13:23:03 +0000 |
| commit | d95ca4a103c9023aa104b25acdc9c21418de6a14 (patch) | |
| tree | 7cff6e45e2dc1ba08deb503589e21770c7f239b3 /src/GF/Grammar/LookAbs.hs | |
| parent | fa7ab84471652c40079e4f77d242208376c4b668 (diff) | |
refactor the GF.Grammar.Grammar syntax. The obsolete constructions are removed
Diffstat (limited to 'src/GF/Grammar/LookAbs.hs')
| -rw-r--r-- | src/GF/Grammar/LookAbs.hs | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/GF/Grammar/LookAbs.hs b/src/GF/Grammar/LookAbs.hs index f9a251eb1..137e602aa 100644 --- a/src/GF/Grammar/LookAbs.hs +++ b/src/GF/Grammar/LookAbs.hs @@ -29,25 +29,19 @@ import Control.Monad -- | this is needed at compile time lookupFunType :: Grammar -> Ident -> Ident -> Err Type lookupFunType gr m c = do - mi <- lookupModule gr m - case mi of - ModMod mo -> do - info <- lookupIdentInfo mo c - case info of - AbsFun (Yes t) _ -> return t - AnyInd _ n -> lookupFunType gr n c - _ -> prtBad "cannot find type of" c - _ -> Bad $ prt m +++ "is not an abstract module" + mo <- lookupModule gr m + info <- lookupIdentInfo mo c + case info of + AbsFun (Yes t) _ -> return t + AnyInd _ n -> lookupFunType gr n c + _ -> prtBad "cannot find type of" c -- | this is needed at compile time lookupCatContext :: Grammar -> Ident -> Ident -> Err Context lookupCatContext gr m c = do - mi <- lookupModule gr m - case mi of - ModMod mo -> do - info <- lookupIdentInfo mo c - case info of - AbsCat (Yes co) _ -> return co - AnyInd _ n -> lookupCatContext gr n c - _ -> prtBad "unknown category" c - _ -> Bad $ prt m +++ "is not an abstract module" + mo <- lookupModule gr m + info <- lookupIdentInfo mo c + case info of + AbsCat (Yes co) _ -> return co + AnyInd _ n -> lookupCatContext gr n c + _ -> prtBad "unknown category" c |
