Skip to content
This repository has been archived by the owner on Feb 10, 2020. It is now read-only.

Commit

Permalink
Fix stupid FFI non-codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolverson committed Nov 30, 2018
1 parent 447e714 commit dd8eeaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Language/PureScript/Make/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ buildMakeActions outputDir filePathMap foreigns usePrefix =
| otherwise -> return ()
for_ (mn `M.lookup` foreigns) (readTextFile >=> writeTextFile foreignFile)
when (S.member Erl codegenTargets) $ do

let mn = CF.moduleName m
moduleDir = outputDir </> T.unpack (runModuleName mn)
foreignFile = moduleDir </> T.unpack (erlModuleName mn ForeignModule) ++ ".erl"
Expand All @@ -245,9 +246,9 @@ buildMakeActions outputDir filePathMap foreigns usePrefix =
| not $ requiresForeign m ->
tell $ errorMessage $ UnnecessaryFFIModule mn path
| otherwise -> pure ()
Nothing -> do
Nothing ->
when (requiresForeign m) $ throwError . errorMessage $ MissingFFIModule mn
for_ (mn `M.lookup` foreigns) (readTextFile >=> writeTextFile foreignFile)
for_ (mn `M.lookup` foreigns) (readTextFile >=> writeTextFile foreignFile)

genSourceMap :: String -> String -> Int -> [SMap] -> Make ()
genSourceMap dir mapFile extraLines mappings = do
Expand Down

0 comments on commit dd8eeaf

Please sign in to comment.