1
0
forked from GitHub/gf-core

generate PMCFG only for complete modules

This commit is contained in:
krangelov
2021-12-15 09:53:45 +01:00
parent b61e870783
commit f793ed4413

View File

@@ -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