From 27c5501ab0e34ae3f73dc18885eebd7778b6a25a Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Fri, 25 Jan 2019 13:02:11 +0100 Subject: [PATCH] Clean up --- derive/src/lib.rs | 19 +------------------ wasmi/examples/tictactoe.rs | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/derive/src/lib.rs b/derive/src/lib.rs index cd5605f..dad9af4 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -56,22 +56,5 @@ pub fn derive_externals(_attr: TokenStream, input: TokenStream) -> TokenStream { let ext_def = parser::parse(input.clone()).unwrap(); codegen::codegen(&ext_def, &mut input); - // We need to generate two types: - // - Externals - // - ModuleImportResolver - - // - for each of declared method collect it's name and it's signature. - // - assign a method index for each method - // - generate a switch for `Externals` that takes the input `index` and jumps - // on the corresponding match arm, which the wrapper. - // The wrapper decodes arguments, calls to the function and handles the result. - // - generate a switch / ifs chain for `ModuleImportResolver`. In each arm it checks if the function - // has an appropriate arguments, and if so allocates a host function with the corresponding index. - // - // and we will then need to return both the original implementation and the generated implementation - // of externals. - - println!("{:?}", quote::quote! { #input }.to_string()); - let input = input.into(); - input + input.into() } diff --git a/wasmi/examples/tictactoe.rs b/wasmi/examples/tictactoe.rs index ed2c660..bc24370 100644 --- a/wasmi/examples/tictactoe.rs +++ b/wasmi/examples/tictactoe.rs @@ -137,7 +137,7 @@ impl<'a> Runtime<'a> { /// Puts a mark of the current player on the given cell. /// /// Traps if the index is out of bounds of game field or if the player - /// already made it's turn. + /// already made its turn. pub fn set(&mut self, idx: i32) -> Result<(), Error> { if self.made_turn { return Err(Error::AlreadyPlayed);