Skip to content

Commit

Permalink
fix compiling loaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWhiting committed Oct 31, 2023
1 parent 76a0db3 commit 80a423c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Backend/C/FromCore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,7 @@ reserved
, "instanceof"
, "new"
, "return"
, "register"
, "switch"
, "this"
, "throw"
Expand Down
7 changes: 5 additions & 2 deletions src/Compiler/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,16 @@ resolveModule compileTarget maybeContents term flags currentDir modules cachedMo
_ -> do
-- Compile from cache if CompileTarget is Executable / Object and module is InMemory and outputFileTime < modTime
if (Just (modTime mod) > modOutputTime mod) then do
liftIO $ termPhaseDoc term (color (colorInterpreter (colorScheme flags)) (text "generating:") <+>
color (colorSource (colorScheme flags))
(pretty (modName mod)))
liftIO $ copyPkgIFaceToOutputDir term flags iface (modCore mod) (modPackageQPath mod) imports
let loaded = initialLoaded { loadedModule = mod
, loadedModules = allmods
}
let ci = coreProgImports (modCore mod)
-- TODO: Ensure this fromJust won't throw, and loaded has everything it needs
doCodeGen term flags loaded loaded compileTarget (fromJust $ modProgram mod) ci
-- TODO: Ensure loaded has everything it needs
liftIO $! codeGen term flags Object loaded
return ()
else return ()
return result
Expand Down

0 comments on commit 80a423c

Please sign in to comment.