Removee debug_msgs feature.

This commit is contained in:
Stephen Chung
2020-03-18 22:03:50 +08:00
parent 019e73bc7e
commit 0dc51f8e59
8 changed files with 6 additions and 52 deletions

View File

@@ -29,20 +29,6 @@ impl<'e> Engine<'e> {
args: Option<Vec<TypeId>>,
f: Box<FnAny>,
) {
debug_println!(
"Register function: {} with {}",
fn_name,
if let Some(a) = &args {
format!(
"{} parameter{}",
a.len(),
if a.len() > 1 { "s" } else { "" }
)
} else {
"no parameter".to_string()
}
);
let spec = FnSpec {
name: fn_name.to_string().into(),
args,

View File

@@ -3,11 +3,12 @@
#![allow(non_snake_case)]
use crate::any::{Any, Dynamic};
use crate::stdlib::{string::String, vec, vec::Vec};
#[cfg(not(feature = "no_index"))]
use crate::engine::Array;
use crate::stdlib::{string::String, vec, vec::Vec};
/// Trait that represent arguments to a function call.
pub trait FuncArgs {
/// Convert to a `Vec` of `Dynamic` arguments.

View File

@@ -165,16 +165,6 @@ impl Engine<'_> {
def_val: Option<&Dynamic>,
pos: Position,
) -> Result<Dynamic, EvalAltResult> {
debug_println!(
"Calling function: {} ({})",
fn_name,
args.iter()
.map(|x| (*x).type_name())
.map(|name| self.map_type_name(name))
.collect::<Vec<_>>()
.join(", ")
);
// First search in script-defined functions (can override built-in)
if let Ok(n) = self
.script_functions

View File

@@ -1,6 +1,7 @@
//! Module containing error definitions for the parsing process.
use crate::parser::Position;
use crate::stdlib::{char, error::Error, fmt, string::String};
/// Error when tokenizing the script text.

View File

@@ -6,6 +6,7 @@ use crate::any::{Any, Dynamic};
use crate::engine::{Engine, FnCallArgs};
use crate::parser::Position;
use crate::result::EvalAltResult;
use crate::stdlib::{any::TypeId, boxed::Box, string::ToString, vec};
/// A trait to register custom functions with the `Engine`.

View File

@@ -43,30 +43,6 @@
#[cfg(feature = "no_std")]
extern crate alloc;
// needs to be here, because order matters for macros
macro_rules! debug_println {
() => (
#[cfg(feature = "debug_msgs")]
{
print!("\n");
}
);
($fmt:expr) => (
#[cfg(feature = "debug_msgs")]
{
print!(concat!($fmt, "\n"));
}
);
($fmt:expr, $($arg:tt)*) => (
#[cfg(feature = "debug_msgs")]
{
print!(concat!($fmt, "\n"), $($arg)*);
}
);
}
#[macro_use]
mod stdlib;
mod any;
mod api;
mod builtin;
@@ -78,6 +54,7 @@ mod optimize;
mod parser;
mod result;
mod scope;
mod stdlib;
pub use any::{Any, AnyExt, Dynamic, Variant};
pub use call::FuncArgs;