fix module idents coding

This commit is contained in:
Ilya Rezvov
2018-03-20 16:51:58 -07:00
parent 13fecfe74b
commit 4bf66b9295
2 changed files with 10 additions and 10 deletions
+10 -9
View File
@@ -1291,27 +1291,28 @@ type Script = [Command]
type Expression = [Instruction] type Expression = [Instruction]
data ModuleDef data ModuleDef
= RawModDef Module = RawModDef (Maybe Ident) Module
| TextModDef (Maybe TL.Text) [TL.Text] | TextModDef (Maybe Ident) [TL.Text]
| BinaryModDef (Maybe TL.Text) [TL.Text] | BinaryModDef (Maybe Ident) [TL.Text]
deriving (Show, Eq) deriving (Show, Eq)
data Command data Command
= ModuleDef ModuleDef = ModuleDef ModuleDef
| Register TL.Text (Maybe Ident)
| Action | Action
| Assertion | Assertion
| Meta | Meta
deriving (Show, Eq) deriving (Show, Eq)
data Action data Action
= Invoke (Maybe TL.Text) TL.Text [Expression] = Invoke (Maybe Ident) TL.Text [Expression]
| Get (Maybe TL.Text) TL.Text | Get (Maybe Ident) TL.Text
deriving (Show, Eq) deriving (Show, Eq)
type FailureString = TL.Text type FailureString = TL.Text
data Assertion data Assertion
= AssertReturn Action Instruction = AssertReturn Action [Expression]
| AssertReturnCanonicalNaN Action | AssertReturnCanonicalNaN Action
| AssertReturnArithmeticNaN Action | AssertReturnArithmeticNaN Action
| AssertTrap (Either Action ModuleDef) FailureString | AssertTrap (Either Action ModuleDef) FailureString
@@ -1321,9 +1322,9 @@ data Assertion
deriving (Show, Eq) deriving (Show, Eq)
data Meta data Meta
= Script (Maybe TL.Text) Script = Script (Maybe Ident) Script
| Input (Maybe TL.Text) TL.Text | Input (Maybe Ident) TL.Text
| Output (Maybe TL.Text) TL.Text | Output (Maybe Ident) TL.Text
deriving (Show, Eq) deriving (Show, Eq)
type Labels = [Maybe Ident] type Labels = [Maybe Ident]
-1
View File
@@ -60,7 +60,6 @@ main = do
let Right mod = Parser.parseModule <$> Lexer.scanner content let Right mod = Parser.parseModule <$> Lexer.scanner content
(modInst, store) <- Interpreter.instantiate Interpreter.emptyStore Interpreter.emptyImports mod (modInst, store) <- Interpreter.instantiate Interpreter.emptyStore Interpreter.emptyImports mod
(`mapM` ["fac-rec", "fac-rec-named", "fac-iter", "fac-iter-named", "fac-opt"]) $ \fn -> do (`mapM` ["fac-rec", "fac-rec-named", "fac-iter", "fac-iter-named", "fac-opt"]) $ \fn -> do
-- (`mapM` ["fac-iter-named"]) $ \fn -> do
let fac = \n -> Interpreter.invokeExport store modInst fn [Interpreter.VI64 n] let fac = \n -> Interpreter.invokeExport store modInst fn [Interpreter.VI64 n]
fac3 <- fac 3 fac3 <- fac 3
fac5 <- fac 5 fac5 <- fac 5