serialize more sections
This commit is contained in:
@@ -182,6 +182,18 @@ instance Serialize Import where
|
|||||||
desc <- get
|
desc <- get
|
||||||
return $ Import sourceModule name desc
|
return $ Import sourceModule name desc
|
||||||
|
|
||||||
|
instance Serialize Table where
|
||||||
|
put (Table tableType) = put tableType
|
||||||
|
get = Table <$> get
|
||||||
|
|
||||||
|
instance Serialize Memory where
|
||||||
|
put (Memory limit) = put limit
|
||||||
|
get = Memory <$> get
|
||||||
|
|
||||||
|
-- instance Serialize Global where
|
||||||
|
-- put (Global globalType expr) = put globalType >> put expr
|
||||||
|
-- get = Global <$> get <*> get
|
||||||
|
|
||||||
instance Serialize Module where
|
instance Serialize Module where
|
||||||
put mod = do
|
put mod = do
|
||||||
-- magic
|
-- magic
|
||||||
@@ -197,4 +209,8 @@ instance Serialize Module where
|
|||||||
|
|
||||||
putSection TypeSection $ types mod
|
putSection TypeSection $ types mod
|
||||||
putSection ImportSection $ imports mod
|
putSection ImportSection $ imports mod
|
||||||
|
putSection FunctionSection $ map funcType $ functions mod
|
||||||
|
putSection TableSection $ tables mod
|
||||||
|
putSection MemorySection $ mems mod
|
||||||
|
-- putSection GlobalSection $ globals mod
|
||||||
get = undefined
|
get = undefined
|
||||||
Reference in New Issue
Block a user