From 3b36b381aa23df910eed7ce9867532eb3de76c87 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Tue, 22 Oct 2024 08:30:51 +0200 Subject: [PATCH] save use of jments --- src/compiler/api/GF/Grammar/Lookup.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/api/GF/Grammar/Lookup.hs b/src/compiler/api/GF/Grammar/Lookup.hs index c469ecc97..c2eb5d6d1 100644 --- a/src/compiler/api/GF/Grammar/Lookup.hs +++ b/src/compiler/api/GF/Grammar/Lookup.hs @@ -178,7 +178,9 @@ lookupOrigInfo gr (m,c) = do allOrigInfos :: Grammar -> ModuleName -> [(QIdent,Info)] allOrigInfos gr m = fromErr [] $ do mo <- lookupModule gr m - return [((m,c),i) | (c,_) <- Map.toList (jments mo), Ok (m,i) <- [lookupOrigInfo gr (m,c)]] + case mo of + ModInfo{jments=jments} -> return [((m,c),i) | (c,_) <- Map.toList jments, Ok (m,i) <- [lookupOrigInfo gr (m,c)]] + _ -> return [] lookupParamValues :: ErrorMonad m => Grammar -> QIdent -> m [Term] lookupParamValues gr c = do @@ -248,8 +250,8 @@ lookupCatContext gr m c = do allOpers :: Grammar -> [(QIdent,Type,Location)] allOpers gr = [((m,op),typ,loc) | - (m,mi) <- maybe [] (allExtends gr) (greatestResource gr), - (op,info) <- Map.toList (jments mi), + (m,mi@ModInfo{jments=jments}) <- maybe [] (allExtends gr) (greatestResource gr), + (op,info) <- Map.toList jments, L loc typ <- typesIn info ] where