From 993ceb63bcec89295485b831bdb974bd7b47c6bc Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 5 Mar 2009 09:08:52 +0000 Subject: in GF.Grammar.Update - remove the indirection before to print the error message --- src/GF/Grammar/Lookup.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/GF/Grammar') diff --git a/src/GF/Grammar/Lookup.hs b/src/GF/Grammar/Lookup.hs index f11f7d428..312cfd38e 100644 --- a/src/GF/Grammar/Lookup.hs +++ b/src/GF/Grammar/Lookup.hs @@ -19,6 +19,7 @@ module GF.Grammar.Lookup ( lookupIdent, lookupIdentInfo, lookupIdentInfoIn, + lookupOrigInfo, lookupResDef, lookupResDefKind, lookupResType, @@ -139,13 +140,14 @@ lookupOverload gr m c = do AnyInd _ n -> lookupOverload gr n c _ -> Bad $ prt c +++ "is not an overloaded operation" -lookupOrigInfo :: SourceGrammar -> Ident -> Ident -> Err Info +-- | returns the original 'Info' and the module where it was found +lookupOrigInfo :: SourceGrammar -> Ident -> Ident -> Err (Ident,Info) lookupOrigInfo gr m c = do mo <- lookupModule gr m info <- lookupIdentInfo mo c case info of AnyInd _ n -> lookupOrigInfo gr n c - i -> return i + i -> return (m,i) lookupParams :: SourceGrammar -> Ident -> Ident -> Err ([Param],Maybe PValues) lookupParams gr = look True where @@ -194,7 +196,7 @@ lookupIndexValue gr ty i = do allOrigInfos :: SourceGrammar -> Ident -> [(Ident,Info)] allOrigInfos gr m = errVal [] $ do mo <- lookupModule gr m - return [(c,i) | (c,_) <- tree2list (jments mo), Ok i <- [look c]] + return [(c,i) | (c,_) <- tree2list (jments mo), Ok (_,i) <- [look c]] where look = lookupOrigInfo gr m -- cgit v1.2.3