diff options
-rw-r--r-- | Cargo.lock | 14 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/main.rs | 4 | ||||
-rw-r--r-- | src/sexp/step.rs | 10 | ||||
-rw-r--r-- | src/sexp/subst.rs | 2 | ||||
-rw-r--r-- | src/sexp/util.rs | 2 | ||||
-rw-r--r-- | src/type/check.rs | 12 | ||||
-rw-r--r-- | src/type/display.rs | 6 | ||||
-rw-r--r-- | src/type/mod.rs | 2 | ||||
-rw-r--r-- | src/type/subst.rs | 2 |
11 files changed, 30 insertions, 28 deletions
@@ -3,19 +3,19 @@ version = 4 [[package]] -name = "melisp" -version = "0.1.0" -dependencies = [ - "nom", -] - -[[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] +name = "myslip" +version = "0.1.0" +dependencies = [ + "nom", +] + +[[package]] name = "nom" version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1,5 +1,5 @@ [package] -name = "melisp" +name = "myslip" version = "0.1.0" edition = "2024" @@ -60,4 +60,6 @@ $ ln ??? ??? $ myslip ``` +Exit the REPL by CTRL+C, CTRL+D or entering "exit". + diff --git a/src/main.rs b/src/main.rs index 80a4066..c518b82 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ -use melisp::parse::parsetree::parse_to_ast; -use melisp::sexp::{SExp::*, SLeaf::Nil}; +use myslip::parse::parsetree::parse_to_ast; +use myslip::sexp::{SExp::*, SLeaf::Nil}; use std::{io, io::Write}; fn main() { diff --git a/src/sexp/step.rs b/src/sexp/step.rs index 1ab0291..ee76ebf 100644 --- a/src/sexp/step.rs +++ b/src/sexp/step.rs @@ -10,7 +10,7 @@ impl SExp { /// Addition, subtraction, multiplication and division /// are supported. /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// scons(Add, scons(1, scons(1, Nil))).step(), @@ -35,7 +35,7 @@ impl SExp { /// /// Division truncates the decimals. /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// scons(Div, scons(5, scons(2, Nil))).step(), @@ -45,7 +45,7 @@ impl SExp { /// /// Also, addition and multiplication can take more than two arguments: /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// scons(Add, scons(1, scons(2, scons(3, Nil)))).step(), @@ -61,7 +61,7 @@ impl SExp { /// Here's an example of a bit more complicated expression /// from wikipedias article on s-expressions. /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// /// fn main() { /// let exp = scons( @@ -92,7 +92,7 @@ impl SExp { /// is evaluated to values, but they are not passed /// to the operator after that. /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// assert_eq!( /// scons(Quote, scons(1, scons(2, Nil))).step(), /// Ok(scons(Quote, scons(1, scons(2, Nil)))) diff --git a/src/sexp/subst.rs b/src/sexp/subst.rs index abab614..87f9b50 100644 --- a/src/sexp/subst.rs +++ b/src/sexp/subst.rs @@ -8,7 +8,7 @@ impl SExp { /// named `name` with the given `value` /// in this s-expression. /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// scons(Add, scons(var("a"), var("b"))).subst("b", &scons(Sub, scons(2, 1))), diff --git a/src/sexp/util.rs b/src/sexp/util.rs index 0818e6b..f01dab9 100644 --- a/src/sexp/util.rs +++ b/src/sexp/util.rs @@ -40,7 +40,7 @@ impl SExp { /// lists aren't Nil-terminated. /// /// ```rust - /// use melisp::sexp::{SExp::*, SLeaf::*, util::*}; + /// use myslip::sexp::{SExp::*, SLeaf::*, util::*}; /// assert_eq!( /// scons(1, scons(2, scons(3, Nil))).into_vec(), /// Ok(vec![Int(1), Int(2), Int(3)]) diff --git a/src/type/check.rs b/src/type/check.rs index 80cc974..9369d97 100644 --- a/src/type/check.rs +++ b/src/type/check.rs @@ -10,7 +10,7 @@ impl SExp { /// /// Examples of simple expressions and their simple types: /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; @@ -20,7 +20,7 @@ impl SExp { /// /// Quotes are given list types: /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*, util::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; @@ -32,7 +32,7 @@ impl SExp { /// ``` /// Though so is Nil given too: /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*, util::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; @@ -45,7 +45,7 @@ impl SExp { /// /// Some common operators get arrow types: /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*, util::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; @@ -60,7 +60,7 @@ impl SExp { /// is to increase safety by being able to warn about errors /// before evaluation. Here are some failing examples: /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*, util::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; @@ -99,7 +99,7 @@ impl SExp { /// Also, free variables should result in an error /// as their type can't be known by the type checker. /// ```rust - /// use melisp::{ + /// use myslip::{ /// r#type::{*, Type::*, TypeError::*, util::*}, /// sexp::{SExp::*, SLeaf::*, util::*}, /// }; diff --git a/src/type/display.rs b/src/type/display.rs index 68d7fec..2fca5f9 100644 --- a/src/type/display.rs +++ b/src/type/display.rs @@ -9,7 +9,7 @@ impl fmt::Display for Type { /// /// Examples: /// ```rust - /// use melisp::r#type::{Type::*, util::*}; + /// use myslip::r#type::{Type::*, util::*}; /// assert_eq!(Integer.to_string(), "Int".to_string()); /// assert_eq!(arr(Integer, Integer).to_string(), "(Int -> Int)".to_string()); /// assert_eq!(List(vec![Integer, Integer, Integer]).to_string(), "(Int Int Int)".to_string()); @@ -37,8 +37,8 @@ impl fmt::Display for TypeError { /// /// Examples: /// ```rust - /// use melisp::r#type::{TypeError::*, Type::*, util::*}; - /// use melisp::sexp::{SExp, SExp::*, SLeaf::*, util::*}; + /// use myslip::r#type::{TypeError::*, Type::*, util::*}; + /// use myslip::sexp::{SExp, SExp::*, SLeaf::*, util::*}; /// /// assert_eq!( /// UndefinedVariable(String::from("x")).to_string(), diff --git a/src/type/mod.rs b/src/type/mod.rs index 2454f31..8761cee 100644 --- a/src/type/mod.rs +++ b/src/type/mod.rs @@ -60,7 +60,7 @@ impl Type { /// /// **Examples** /// ```rust - /// use melisp::r#type::{*, Type::*, TypeError::*, util::*}; + /// use myslip::r#type::{*, Type::*, TypeError::*, util::*}; /// /// assert_eq!(Integer.is_concrete(), Ok(())); /// assert_eq!( diff --git a/src/type/subst.rs b/src/type/subst.rs index 6e92584..1774770 100644 --- a/src/type/subst.rs +++ b/src/type/subst.rs @@ -8,7 +8,7 @@ impl Type { /// named `name` with the given type `value` /// in the type. /// ```rust - /// use melisp::r#type::{Type::*, util::*}; + /// use myslip::r#type::{Type::*, util::*}; /// /// assert_eq!( /// List(vec![Integer, arr(Integer, VarType("A".to_string())), VarType("B".to_string())]) |