calculate module instance
This commit is contained in:
@@ -33,7 +33,11 @@ module Language.Wasm.Structure (
|
||||
LabelIndex,
|
||||
LocalIndex,
|
||||
GlobalIndex,
|
||||
emptyModule
|
||||
emptyModule,
|
||||
isFuncImport,
|
||||
isTableImport,
|
||||
isMemImport,
|
||||
isGlobalImport
|
||||
) where
|
||||
|
||||
import Numeric.Natural (Natural)
|
||||
@@ -232,6 +236,22 @@ data Import = Import {
|
||||
desc :: ImportDesc
|
||||
} deriving (Show, Eq)
|
||||
|
||||
isFuncImport :: Import -> Bool
|
||||
isFuncImport (Import _ _ (ImportFunc _)) = True
|
||||
isFuncImport _ = False
|
||||
|
||||
isTableImport :: Import -> Bool
|
||||
isTableImport (Import _ _ (ImportTable _)) = True
|
||||
isTableImport _ = False
|
||||
|
||||
isMemImport :: Import -> Bool
|
||||
isMemImport (Import _ _ (ImportMemory _)) = True
|
||||
isMemImport _ = False
|
||||
|
||||
isGlobalImport :: Import -> Bool
|
||||
isGlobalImport (Import _ _ (ImportGlobal _)) = True
|
||||
isGlobalImport _ = False
|
||||
|
||||
data Module = Module {
|
||||
types :: [FuncType],
|
||||
functions :: [Function],
|
||||
|
||||
Reference in New Issue
Block a user