Remove wasm64 target.
This commit is contained in:
parent
84fbcb03b3
commit
e095a87ea2
@ -25,7 +25,6 @@ use crate::stdlib::{
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
use crate::stdlib::time::Instant;
|
||||
|
||||
/// Trait to represent any type.
|
||||
@ -195,7 +194,6 @@ impl Dynamic {
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Union::Variant(value) if value.is::<Instant>() => "timestamp",
|
||||
Union::Variant(value) => (***value).type_name(),
|
||||
}
|
||||
@ -220,7 +218,6 @@ impl fmt::Display for Dynamic {
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Union::Variant(value) if value.is::<Instant>() => write!(f, "<timestamp>"),
|
||||
Union::Variant(_) => write!(f, "?"),
|
||||
}
|
||||
@ -245,7 +242,6 @@ impl fmt::Debug for Dynamic {
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Union::Variant(value) if value.is::<Instant>() => write!(f, "<timestamp>"),
|
||||
Union::Variant(_) => write!(f, "<dynamic>"),
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ use crate::stdlib::{
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
use crate::stdlib::{fs::File, io::prelude::*, path::PathBuf};
|
||||
|
||||
/// Engine public API
|
||||
@ -556,7 +555,6 @@ impl Engine {
|
||||
/// Read the contents of a file into a string.
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
fn read_file(path: PathBuf) -> Result<String, Box<EvalAltResult>> {
|
||||
let mut f = File::open(path.clone()).map_err(|err| {
|
||||
Box::new(EvalAltResult::ErrorReadingScriptFile(
|
||||
@ -601,7 +599,6 @@ impl Engine {
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn compile_file(&self, path: PathBuf) -> Result<AST, Box<EvalAltResult>> {
|
||||
self.compile_file_with_scope(&Scope::new(), path)
|
||||
}
|
||||
@ -639,7 +636,6 @@ impl Engine {
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn compile_file_with_scope(
|
||||
&self,
|
||||
scope: &Scope,
|
||||
@ -782,7 +778,6 @@ impl Engine {
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn eval_file<T: Variant + Clone>(&self, path: PathBuf) -> Result<T, Box<EvalAltResult>> {
|
||||
Self::read_file(path).and_then(|contents| self.eval::<T>(&contents))
|
||||
}
|
||||
@ -808,7 +803,6 @@ impl Engine {
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn eval_file_with_scope<T: Variant + Clone>(
|
||||
&self,
|
||||
scope: &mut Scope,
|
||||
@ -1015,7 +1009,6 @@ impl Engine {
|
||||
/// Useful for when you don't need the result, but still need to keep track of possible errors.
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn consume_file(&self, path: PathBuf) -> Result<(), Box<EvalAltResult>> {
|
||||
Self::read_file(path).and_then(|contents| self.consume(&contents))
|
||||
}
|
||||
@ -1024,7 +1017,6 @@ impl Engine {
|
||||
/// Useful for when you don't need the result, but still need to keep track of possible errors.
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub fn consume_file_with_scope(
|
||||
&self,
|
||||
scope: &mut Scope,
|
||||
|
@ -293,14 +293,8 @@ impl Default for Engine {
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
module_resolver: Some(Box::new(resolvers::FileModuleResolver::new())),
|
||||
#[cfg(any(
|
||||
feature = "no_module",
|
||||
feature = "no_std",
|
||||
target_arch = "wasm32",
|
||||
target_arch = "wasm64"
|
||||
))]
|
||||
#[cfg(any(feature = "no_module", feature = "no_std", target_arch = "wasm32",))]
|
||||
module_resolver: None,
|
||||
|
||||
type_names: HashMap::new(),
|
||||
@ -381,7 +375,6 @@ fn extract_prop_from_setter(fn_name: &str) -> Option<&str> {
|
||||
fn default_print(s: &str) {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
println!("{}", s);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
//!
|
||||
//! # #[cfg(not(feature = "no_std"))]
|
||||
//! # #[cfg(not(target_arch = "wasm32"))]
|
||||
//! # #[cfg(not(target_arch = "wasm64"))]
|
||||
//! assert_eq!(
|
||||
//! // Evaluate the script, expects a 'bool' return
|
||||
//! engine.eval_file::<bool>("my_script.rhai".into())?,
|
||||
|
@ -1055,7 +1055,6 @@ pub trait ModuleResolver: SendSync {
|
||||
pub mod resolvers {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub use super::file::FileModuleResolver;
|
||||
pub use super::stat::StaticModuleResolver;
|
||||
}
|
||||
@ -1066,7 +1065,6 @@ pub mod resolvers {}
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
mod file {
|
||||
use super::*;
|
||||
use crate::stdlib::path::PathBuf;
|
||||
|
@ -34,7 +34,6 @@ pub use string_basic::BasicStringPackage;
|
||||
pub use string_more::MoreStringPackage;
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub use time_basic::BasicTimePackage;
|
||||
|
||||
/// Trait that all packages must implement.
|
||||
|
@ -7,7 +7,6 @@ use super::pkg_core::CorePackage;
|
||||
use super::string_more::MoreStringPackage;
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
use super::time_basic::BasicTimePackage;
|
||||
|
||||
use crate::def_package;
|
||||
@ -21,7 +20,6 @@ def_package!(crate:StandardPackage:"_Standard_ package containing all built-in f
|
||||
BasicMapPackage::init(lib);
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
BasicTimePackage::init(lib);
|
||||
MoreStringPackage::init(lib);
|
||||
});
|
||||
|
@ -1,5 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
#![cfg(not(target_arch = "wasm64"))]
|
||||
|
||||
use super::logic::{eq, gt, gte, lt, lte, ne};
|
||||
use super::math_basic::MAX_INT;
|
||||
|
@ -14,7 +14,6 @@ use crate::stdlib::{
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
use crate::stdlib::path::PathBuf;
|
||||
|
||||
/// Evaluation result.
|
||||
@ -32,7 +31,6 @@ pub enum EvalAltResult {
|
||||
/// Never appears under the `no_std` feature.
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
ErrorReadingScriptFile(PathBuf, Position, std::io::Error),
|
||||
|
||||
/// Call to an unknown function. Wrapped value is the name of the function.
|
||||
@ -106,8 +104,7 @@ impl EvalAltResult {
|
||||
match self {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Self::ErrorReadingScriptFile(_, _, _) => "Cannot read from script file",
|
||||
Self::ErrorReadingScriptFile(_, _, _) => "Cannot read from script file",
|
||||
|
||||
Self::ErrorParsing(p, _) => p.desc(),
|
||||
Self::ErrorInFunctionCall(_, _, _) => "Error in called function",
|
||||
@ -167,7 +164,6 @@ impl fmt::Display for EvalAltResult {
|
||||
match self {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Self::ErrorReadingScriptFile(path, _, err) => {
|
||||
write!(f, "{} '{}': {}", desc, path.display(), err)?
|
||||
}
|
||||
@ -268,7 +264,6 @@ impl EvalAltResult {
|
||||
match self {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Self::ErrorReadingScriptFile(_, pos, _) => *pos,
|
||||
|
||||
Self::ErrorParsing(_, pos)
|
||||
@ -308,7 +303,6 @@ impl EvalAltResult {
|
||||
match self {
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
Self::ErrorReadingScriptFile(_, pos, _) => *pos = new_position,
|
||||
|
||||
Self::ErrorParsing(_, pos)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#![cfg(not(feature = "no_std"))]
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
#![cfg(not(target_arch = "wasm64"))]
|
||||
|
||||
use rhai::{Engine, EvalAltResult, INT};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user