This commit is contained in:
Able 2024-12-04 02:41:11 -06:00
parent d71964787b
commit be24d49c77
3 changed files with 13 additions and 17 deletions

View file

@ -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) => {{

View file

@ -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;

View file

@ -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<String> {
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())
}
}