From be24d49c770cad3269491f40940673af54f13569 Mon Sep 17 00:00:00 2001 From: Able Date: Wed, 4 Dec 2024 02:41:11 -0600 Subject: [PATCH] update --- src/environ.rs | 8 ++++---- src/lib.rs | 2 -- src/parser.rs | 20 +++++++++----------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/environ.rs b/src/environ.rs index 4991441..e71ea0c 100755 --- a/src/environ.rs +++ b/src/environ.rs @@ -1,7 +1,7 @@ -use crate::lib::parse_list_of_floats; -use crate::lib::Expr; -use crate::lib::HashMap; -use crate::lib::RispError; +use crate::parse_list_of_floats; +use crate::Expr; +use crate::HashMap; +use crate::RispError; macro_rules! ensure_tonicity { ($check_fn:expr) => {{ diff --git a/src/lib.rs b/src/lib.rs index c1e848e..eb54c77 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,8 +3,6 @@ use core::fmt; use core::num::ParseFloatError; // use std::hash::DefaultHasher; -extern crate alloc; - pub use hashbrown::hash_map::HashMap; pub use std::io::Write; diff --git a/src/parser.rs b/src/parser.rs index 35df025..975eef1 100755 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,9 +1,9 @@ -use crate::lib::evaluate::eval; -use crate::lib::read_seq; -use crate::lib::Environ; -use crate::lib::Expr; -use crate::lib::ParseFloatError; -use crate::lib::RispError; +use crate::evaluate::eval; +use crate::read_seq; +use crate::Environ; +use crate::Expr; +use crate::ParseFloatError; +use crate::RispError; pub fn tokenize(expr: String) -> Vec { expr.replace("(", " ( ") @@ -45,15 +45,13 @@ fn parse_atom(token: &str) -> Expr { match potential_float { Ok(v) => Number(v), Err(_er) => { - if token.to_string().starts_with("\"") && token.to_string().ends_with("\""){ + if token.to_string().starts_with("\"") && token.to_string().ends_with("\"") { let mut stri = token.to_string().clone(); stri.remove(0); stri.pop(); - - Str(stri) - }else{ - + Str(stri) + } else { Symbol(token.to_string().clone()) } }