From f793ed441340897d26c6486def3798605c8d0751 Mon Sep 17 00:00:00 2001 From: krangelov Date: Wed, 15 Dec 2021 09:53:45 +0100 Subject: [PATCH] generate PMCFG only for complete modules --- src/compiler/GF/Compile/GeneratePMCFG.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index acc6a8646..6708e8e9c 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -29,10 +29,11 @@ import Data.Maybe(fromMaybe) generatePMCFG :: Options -> FilePath -> SourceGrammar -> SourceModule -> Check SourceModule generatePMCFG opts cwd gr cmo@(cm,cmi) - | isModCnc cmi = do let gr' = prependModule gr cmo - js <- mapM (addPMCFG opts cwd gr' cmi) (Map.toList (jments cmi)) - return (cm,cmi{jments = (Map.fromAscList js)}) - | otherwise = return cmo + | mstatus cmi == MSComplete && isModCnc cmi = + do let gr' = prependModule gr cmo + js <- mapM (addPMCFG opts cwd gr' cmi) (Map.toList (jments cmi)) + return (cm,cmi{jments = (Map.fromAscList js)}) + | otherwise = return cmo addPMCFG opts cwd gr cmi (id,CncCat mty@(Just (L loc ty)) mdef mref mprn Nothing) = do defs <- case mdef of