Literal -> Lit, LitE -> Lit

This commit is contained in:
crumbtoo
2023-12-18 15:36:17 -07:00
parent 585130cfac
commit 136e3687b0
5 changed files with 12 additions and 12 deletions

View File

@@ -617,7 +617,7 @@ buildInitialHeap (Program ss) = mapAccumL allocateSc mempty compiledScs
f (NameKey n, _) = Just n
f _ = Nothing
compileC _ (LitE l) = compileCL l
compileC _ (Lit l) = compileCL l
-- >> [ref/compileC]
compileC g (App f x) = compileC g x
@@ -661,16 +661,16 @@ buildInitialHeap (Program ss) = mapAccumL allocateSc mempty compiledScs
compileC _ _ = error "yet to be implemented!"
compileCL :: Literal -> Code
compileCL :: Lit -> Code
compileCL (IntL n) = [PushInt n]
compileEL :: Literal -> Code
compileEL :: Lit -> Code
compileEL (IntL n) = [PushInt n]
-- compile an expression in a strict context such that a pointer to the
-- expression is left on top of the stack in WHNF
compileE :: Env -> Expr' -> Code
compileE _ (LitE l) = compileEL l
compileE _ (Lit l) = compileEL l
compileE g (Let NonRec bs e) =
-- we use compileE instead of compileC
mconcat binders <> compileE g' e <> [Slide d]