From ed3d696ebe1a16143fb1bcb58be3738681f6c4dd Mon Sep 17 00:00:00 2001 From: Able Date: Wed, 4 Dec 2024 02:44:59 -0600 Subject: [PATCH] forgot the no_std attr --- src/environ.rs | 4 +++- src/evaluate.rs | 19 ++++++++++++------- src/lib.rs | 17 ++++++++++++++--- src/parser.rs | 4 ++++ 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/environ.rs b/src/environ.rs index e71ea0c..e32828f 100755 --- a/src/environ.rs +++ b/src/environ.rs @@ -1,8 +1,10 @@ +use alloc::string::String; + +use crate::alloc::string::ToString; use crate::parse_list_of_floats; use crate::Expr; use crate::HashMap; use crate::RispError; - macro_rules! ensure_tonicity { ($check_fn:expr) => {{ |args: &[Expr]| -> Result { diff --git a/src/evaluate.rs b/src/evaluate.rs index 40cc9aa..9448f82 100755 --- a/src/evaluate.rs +++ b/src/evaluate.rs @@ -1,10 +1,15 @@ -use crate::lib::environ::env_get; -use crate::lib::Environ; -use crate::lib::Expr; -use crate::lib::HashMap; -use crate::lib::RLambda; -use crate::lib::Rc; -use crate::lib::RispError; +use alloc::format; +use alloc::string::String; +use alloc::string::ToString; +use alloc::vec::Vec; + +use crate::environ::env_get; +use crate::Environ; +use crate::Expr; +use crate::HashMap; +use crate::RLambda; +use crate::Rc; +use crate::RispError; pub fn eval(exp: &Expr, env: &mut Environ) -> Result { match exp { diff --git a/src/lib.rs b/src/lib.rs index eb54c77..3dd2ef2 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,23 @@ +#![feature(slice_take)] +#![allow(special_module_name)] +#![feature(build_hasher_default_const_new)] +#![no_std] use core::fmt; use core::num::ParseFloatError; // use std::hash::DefaultHasher; +use alloc::fmt::format; +use alloc::rc::Rc; +use alloc::string::String; +use alloc::string::ToString; +use alloc::vec::Vec; pub use hashbrown::hash_map::HashMap; - -pub use std::io::Write; -pub use std::rc::Rc; +pub extern crate alloc; +use alloc::format; +use alloc::vec; +// pub use alloc::; +// pub use core::rc::Rc; mod environ; pub use environ::default_env; diff --git a/src/parser.rs b/src/parser.rs index 975eef1..42a4253 100755 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,3 +1,7 @@ +use alloc::string::String; +use alloc::string::ToString; +use alloc::vec::Vec; + use crate::evaluate::eval; use crate::read_seq; use crate::Environ;