Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 7, 2024
1 parent 7150bd5 commit 22a65a7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/Juvix/Compiler/Nockma/Translation/FromTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ data CompilerCtx = CompilerCtx
-- | Maps temporary variables to their stack indices.
_compilerTempVarMap :: HashMap Int TempRef,
_compilerTempVarsNum :: Int,
_compilerStackHeight :: Int,
_compilerOptions :: CompilerOptions
_compilerStackHeight :: Int
}

emptyCompilerCtx :: CompilerCtx
Expand All @@ -133,8 +132,7 @@ emptyCompilerCtx =
_compilerConstructorInfos = mempty,
_compilerTempVarMap = mempty,
_compilerTempVarsNum = 0,
_compilerStackHeight = 0,
_compilerOptions = CompilerOptions True
_compilerStackHeight = 0
}

data ConstructorInfo = ConstructorInfo
Expand Down Expand Up @@ -723,13 +721,9 @@ compile = \case

goTrace :: Term Natural -> Sem r (Term Natural)
goTrace arg = do
enabled <- asks (^. compilerOptions . compilerOptionsEnableTrace)
if
| enabled ->
withTemp arg $ \ref -> do
val <- addressTempRef ref
return $ OpHint # (nockHintAtom NockHintPuts # val) # val
| otherwise -> return arg
withTemp arg $ \ref -> do
val <- addressTempRef ref
return $ OpHint # (nockHintAtom NockHintPuts # val) # val

goBinop :: Tree.NodeBinop -> Sem r (Term Natural)
goBinop Tree.NodeBinop {..} = do
Expand Down Expand Up @@ -953,7 +947,7 @@ remakeList :: (Foldable l) => l (Term Natural) -> Term Natural
remakeList ts = foldTerms (toList ts `prependList` pure (OpQuote # nockNilTagged "remakeList"))

runCompilerWith :: CompilerOptions -> ConstructorInfos -> [CompilerFunction] -> CompilerFunction -> AnomaResult
runCompilerWith opts constrs moduleFuns mainFun =
runCompilerWith _opts constrs moduleFuns mainFun =
AnomaResult
{ _anomaClosure = mainClosure
}
Expand Down

0 comments on commit 22a65a7

Please sign in to comment.