use prependModule to make the current module available

This commit is contained in:
krangelov
2021-10-08 11:56:28 +02:00
parent 6a9254816d
commit 15e3ca9acd

View File

@@ -23,7 +23,8 @@ import qualified Data.Map.Strict as Map
generatePMCFG :: Options -> SourceGrammar -> SourceModule -> Check SourceModule
generatePMCFG opts gr cmo@(cm,cmi) = do
js <- mapM (addPMCFG opts gr) (Map.toList (jments cmi))
let gr' = prependModule gr cmo
js <- mapM (addPMCFG opts gr') (Map.toList (jments cmi))
return (cm,cmi{jments = (Map.fromAscList js)})
addPMCFG opts gr (id,CncFun mty@(Just (cat,ctxt,val)) mlin@(Just (L loc term)) mprn Nothing) = do