Skip to content

Commit

Permalink
save use of jments
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Oct 22, 2024
1 parent f3a1fad commit 3b36b38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/compiler/api/GF/Grammar/Lookup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b36b38

Please sign in to comment.