diff options
| author | krangelov <kr.angelov@gmail.com> | 2019-09-20 10:37:50 +0200 |
|---|---|---|
| committer | krangelov <kr.angelov@gmail.com> | 2019-09-20 10:37:50 +0200 |
| commit | 4d79aa8b198f411d0ab6d66d76d9f77dfd3f922f (patch) | |
| tree | 0f72e72c6f5ccf57111b22cdb736b3290c86d1dd /src/compiler/GF/Grammar/Lookup.hs | |
| parent | 9d3badd8b225378269814e79395ae48beb83fa4d (diff) | |
remove obsolete code
Diffstat (limited to 'src/compiler/GF/Grammar/Lookup.hs')
| -rw-r--r-- | src/compiler/GF/Grammar/Lookup.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/GF/Grammar/Lookup.hs b/src/compiler/GF/Grammar/Lookup.hs index 9435d1ec4..68c0191ae 100644 --- a/src/compiler/GF/Grammar/Lookup.hs +++ b/src/compiler/GF/Grammar/Lookup.hs @@ -51,11 +51,11 @@ lock c = lockRecType c -- return unlock c = unlockRecord c -- return -- to look up a constant etc in a search tree --- why here? AR 29/5/2008 -lookupIdent :: ErrorMonad m => Ident -> BinTree Ident b -> m b +lookupIdent :: ErrorMonad m => Ident -> Map.Map Ident b -> m b lookupIdent c t = - case lookupTree showIdent c t of - Ok v -> return v - Bad _ -> raise ("unknown identifier" +++ showIdent c) + case Map.lookup c t of + Just v -> return v + Nothing -> raise ("unknown identifier" +++ showIdent c) lookupIdentInfo :: ErrorMonad m => SourceModInfo -> Ident -> m Info lookupIdentInfo mo i = lookupIdent i (jments mo) @@ -148,7 +148,7 @@ lookupOrigInfo gr (m,c) = do allOrigInfos :: Grammar -> ModuleName -> [(QIdent,Info)] allOrigInfos gr m = fromErr [] $ do mo <- lookupModule gr m - return [((m,c),i) | (c,_) <- tree2list (jments mo), Ok (m,i) <- [lookupOrigInfo gr (m,c)]] + return [((m,c),i) | (c,_) <- Map.toList (jments mo), Ok (m,i) <- [lookupOrigInfo gr (m,c)]] lookupParamValues :: ErrorMonad m => Grammar -> QIdent -> m [Term] lookupParamValues gr c = do |
