lamlol
This commit is contained in:
@@ -72,6 +72,7 @@ data Module = MkModule
|
||||
|
||||
data Func = MkFunc
|
||||
{ code :: Text
|
||||
, numLocals :: Int
|
||||
}
|
||||
deriving (Show, Generic)
|
||||
|
||||
@@ -92,13 +93,12 @@ lower' :: Env -> Exp -> Vector Text
|
||||
|
||||
lower' g (Halt [e]) = lowerVal g e
|
||||
|
||||
lower' g (ExpPrim p rs es) =
|
||||
lower' g (ExpPrim p rs e) =
|
||||
case p of
|
||||
PrimAdd x y -> lowerBinOp "i32.add" g x y r e
|
||||
PrimMul x y -> lowerBinOp "i32.mul" g x y r e
|
||||
where
|
||||
r = head rs
|
||||
e = head es
|
||||
|
||||
lowerBinOp op g x y r e =
|
||||
lowerVal g x
|
||||
|
||||
Reference in New Issue
Block a user