update text and binary parsers to new elem formats

This commit is contained in:
Ilya Rezvov
2022-02-01 21:18:12 -07:00
parent 960acac955
commit 8af7b45681
4 changed files with 126 additions and 26 deletions
+10 -3
View File
@@ -6,6 +6,7 @@ module Language.Wasm.Structure (
Module(..),
DataSegment(..),
ElemSegment(..),
ElemMode(..),
StartFunction(..),
Export(..),
ExportDesc(..),
@@ -228,10 +229,16 @@ data Global = Global {
initializer :: Expression
} deriving (Show, Eq, Generic, NFData)
data ElemMode =
Passive
| Active TableIndex Expression
| Declarative
deriving (Show, Eq, Generic, NFData)
data ElemSegment = ElemSegment {
tableIndex :: TableIndex,
offset :: Expression,
funcIndexes :: [FuncIndex]
elemType :: ElemType,
mode :: ElemMode,
elements :: [Expression]
} deriving (Show, Eq, Generic, NFData)
data DataSegment = DataSegment {