aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-15 10:36:58 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-15 10:36:58 -0500
commit134713a6c3620bf5b71ceaa2b6bed3a228d1c297 (patch)
tree37c1759b1cb0e791dffa445115065ad558261533 /bootstrap/src
parent84884be16503e506cd5ad7f927297fd7d25de779 (diff)
downloadfpm-134713a6c3620bf5b71ceaa2b6bed3a228d1c297.tar.gz
fpm-134713a6c3620bf5b71ceaa2b6bed3a228d1c297.zip
Add test for modules a module uses
Diffstat (limited to 'bootstrap/src')
-rw-r--r--bootstrap/src/BuildModel.hs5
1 files changed, 4 insertions, 1 deletions
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