From 134713a6c3620bf5b71ceaa2b6bed3a228d1c297 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 15 Oct 2020 10:36:58 -0500 Subject: Add test for modules a module uses --- bootstrap/src/BuildModel.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bootstrap/src') diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs index 6446a12..1610784 100644 --- a/bootstrap/src/BuildModel.hs +++ b/bootstrap/src/BuildModel.hs @@ -45,6 +45,7 @@ data Source = | Module { moduleSourceFileName :: FilePath , moduleObjectFileName :: FilePath -> FilePath + , moduleModulesUsed :: [String] } processRawSource :: RawSource -> Source @@ -53,14 +54,16 @@ processRawSource rawSource = parsedContents = parseContents rawSource objectFileName = \bd -> bd (pathSeparatorsToUnderscores sourceFileName) <.> "o" + modulesUsed = getModulesUsed parsedContents in if hasProgramDeclaration parsedContents then Program { programSourceFileName = sourceFileName , programObjectFileName = objectFileName - , programModulesUsed = getModulesUsed parsedContents + , programModulesUsed = modulesUsed } else if hasModuleDeclaration parsedContents then Module { moduleSourceFileName = sourceFileName , moduleObjectFileName = objectFileName + , moduleModulesUsed = modulesUsed } else undefined -- cgit v1.2.3