Add export_func macro, prelude, and rename imports stuff

This commit is contained in:
Lachlan Sneff
2019-01-21 14:43:04 -08:00
parent c25fce1721
commit 10c5aa02a2
13 changed files with 81 additions and 63 deletions

View File

@ -3,7 +3,7 @@
extern crate field_offset;
#[macro_use]
pub mod macros;
mod macros;
#[doc(hidden)]
pub mod backend;
mod backing;
@ -29,6 +29,17 @@ pub use self::instance::Instance;
pub use self::module::Module;
use std::rc::Rc;
pub mod prelude {
pub use crate::export_func;
pub use crate::import::{ImportObject, Namespace};
pub use crate::types::{
FuncIndex, GlobalIndex, ImportedFuncIndex, ImportedGlobalIndex, ImportedMemoryIndex,
ImportedTableIndex, LocalFuncIndex, LocalGlobalIndex, LocalMemoryIndex, LocalTableIndex,
MemoryIndex, TableIndex, Type, Value,
};
pub use crate::vm;
}
/// Compile a webassembly module using the provided compiler.
pub fn compile(wasm: &[u8], compiler: &dyn backend::Compiler) -> CompileResult<module::Module> {
let token = backend::Token::generate();