+WasmFileFormat
This commit is contained in:
@@ -3,6 +3,13 @@ module Wasm.WasmParser where
|
|||||||
import Options.Applicative
|
import Options.Applicative
|
||||||
import Data.Semigroup ((<>))
|
import Data.Semigroup ((<>))
|
||||||
|
|
||||||
|
data WasmFileFormat = WasmText | WasmBinary | WasmScript deriving (Read, Show)
|
||||||
|
|
||||||
|
instance Read WasmFileFormat where
|
||||||
|
readsPrec _ ("WAT":xs) = [ (WasmText, xs) ]
|
||||||
|
readsPrec _ ("WAST":xs) = [ (WasmScript, xs) ]
|
||||||
|
readsPrec _ ("WASM":xs) = [ (WasmBinary, xs) ]
|
||||||
|
|
||||||
data WasmParser = WasmParser
|
data WasmParser = WasmParser
|
||||||
{ hello :: String
|
{ hello :: String
|
||||||
, quiet :: Bool
|
, quiet :: Bool
|
||||||
|
|||||||
Reference in New Issue
Block a user