forked from GitHub/haskell-wasm
fix imports
This commit is contained in:
@@ -621,7 +621,7 @@ typedef :: { TypeDef }
|
||||
: 'type' opt(ident) functype ')' { TypeDef $2 $3 }
|
||||
|
||||
functype :: { FuncType }
|
||||
: '(' 'func' typesign(never, ')') { let (ft, _) = $3 in ft }
|
||||
: '(' 'func' typesign(')', ')') { let (ft, _) = $3 in ft }
|
||||
|
||||
memarg1 :: { MemArg }
|
||||
: opt(offset) opt(align) {% parseMemArg 1 $1 $2 }
|
||||
@@ -715,7 +715,7 @@ folded_else :: { [Instruction] }
|
||||
| '(' 'else' mixed_instruction_list(')') ')' { snd $3 }
|
||||
|
||||
importdesc :: { ImportDesc }
|
||||
: 'func' opt(ident) typeuse_cont(never, ')') {
|
||||
: 'func' opt(ident) typeuse_cont(')', ')') {
|
||||
let (ft, _) = $3 in ImportFunc $2 ft
|
||||
}
|
||||
| 'table' opt(ident) tabletype ')' { ImportTable $2 $3 }
|
||||
@@ -747,7 +747,7 @@ export_import_typeuse_locals_body1 :: { Maybe Ident -> ModuleField }
|
||||
| import_typeuse_locals_body1 { $1 }
|
||||
|
||||
import_typeuse_locals_body1 :: { Maybe Ident -> ModuleField }
|
||||
: 'import' name name ')' typeuse_cont(never, ')') {
|
||||
: 'import' name name ')' typeuse_cont(')', ')') {
|
||||
let (ft, _) = $5 in
|
||||
\ident -> MFImport $ Import [] $2 $3 $ ImportFunc ident ft
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ runScript onAssertFail script = do
|
||||
hostGlobals = do
|
||||
let globI32 = Interpreter.makeConstGlobal $ Interpreter.VI32 666
|
||||
let globI64 = Interpreter.makeConstGlobal $ Interpreter.VI64 666
|
||||
globF32 <- Interpreter.makeMutGlobal $ Interpreter.VF32 666
|
||||
globF64 <- Interpreter.makeMutGlobal $ Interpreter.VF64 666
|
||||
let globF32 = Interpreter.makeConstGlobal $ Interpreter.VF32 666
|
||||
let globF64 = Interpreter.makeConstGlobal $ Interpreter.VF64 666
|
||||
return (
|
||||
Interpreter.HostGlobal globI32,
|
||||
Interpreter.HostGlobal globI64,
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import qualified Data.List as List
|
||||
main :: IO ()
|
||||
main = do
|
||||
files <- filter (List.isSuffixOf ".wast") <$> Directory.listDirectory "tests/spec"
|
||||
-- let files = ["block.wast", "loop.wast", "if.wast", "stack.wast", "func.wast"]
|
||||
-- let files = ["imports.wast", "block.wast", "loop.wast", "if.wast", "stack.wast", "func.wast"]
|
||||
scriptTestCases <- (`mapM` files) $ \file -> do
|
||||
test <- LBS.readFile ("tests/spec/" ++ file)
|
||||
return $ testCase file $ do
|
||||
|
||||
Reference in New Issue
Block a user