Validator extracted.

This commit is contained in:
Sergey Pepyakin
2017-12-01 15:35:01 +03:00
parent 12a1bcfe04
commit 040cbb5056
12 changed files with 1161 additions and 195 deletions

View File

@ -1,6 +1,7 @@
//! WebAssembly interpreter module.
use std::any::TypeId;
use validation;
/// Custom user error.
pub trait UserError: 'static + ::std::fmt::Display + ::std::fmt::Debug {
@ -116,6 +117,18 @@ impl<U> From<U> for Error where U: UserError + Sized {
}
}
impl From<validation::Error> for Error {
fn from(e: validation::Error) -> Self {
Error::Validation(e.to_string())
}
}
impl From<::common::stack::Error> for Error {
fn from(e: ::common::stack::Error) -> Self {
Error::Stack(e.to_string())
}
}
mod native;
mod imports;
mod memory;
@ -124,7 +137,6 @@ mod program;
mod runner;
mod stack;
mod table;
mod validator;
mod value;
mod variable;