start multivalue proposal implementation for block instruction

This commit is contained in:
Ilya Rezvov
2021-03-15 22:59:10 -07:00
parent 511bae84e8
commit b1874dfcea
7 changed files with 92 additions and 36 deletions
+7 -1
View File
@@ -30,6 +30,7 @@ module Language.Wasm.Structure (
GlobalType(..),
FuncType(..),
ValueType(..),
BlockType(..),
ParamsType,
ResultType,
LocalsType,
@@ -115,11 +116,16 @@ type LocalsType = [ValueType]
data FuncType = FuncType { params :: ParamsType, results :: ResultType } deriving (Show, Eq, Generic, NFData)
data BlockType =
Inline (Maybe ValueType)
| TypeIndex TypeIndex
deriving (Show, Eq, Generic, NFData)
data Instruction index =
-- Control instructions
Unreachable
| Nop
| Block { resultType :: ResultType, body :: Expression }
| Block { blockType :: BlockType, body :: Expression }
| Loop { resultType :: ResultType, body :: Expression }
| If { resultType :: ResultType, true :: Expression, false :: Expression }
| Br index