aboutsummaryrefslogtreecommitdiff
path: root/src/sexp
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-09 21:18:48 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-09 21:18:48 +0300
commit8062ed87d30fa7628f26cfd7bb94bb0e7401752b (patch)
tree706bf5e34678622111a23c7045f667c1acbe7c6d /src/sexp
parent3e1bf7f9946efe70d452c71494ac77ed39110804 (diff)
downloadmyslip-8062ed87d30fa7628f26cfd7bb94bb0e7401752b.tar.gz
myslip-8062ed87d30fa7628f26cfd7bb94bb0e7401752b.zip
Revert adding of print (its behavior was poorly designed).
This reverts commit 3e1bf7f9946efe70d452c71494ac77ed39110804.
Diffstat (limited to 'src/sexp')
-rw-r--r--src/sexp/display.rs1
-rw-r--r--src/sexp/mod.rs4
-rw-r--r--src/sexp/step.rs15
-rw-r--r--src/sexp/util.rs7
4 files changed, 1 insertions, 26 deletions
diff --git a/src/sexp/display.rs b/src/sexp/display.rs
index dc5d6cb..c3db144 100644
--- a/src/sexp/display.rs
+++ b/src/sexp/display.rs
@@ -27,7 +27,6 @@ impl fmt::Display for SLeaf {
Var(s) => s.to_string(),
Quote => "quote".to_string(),
Vector => "vector".to_string(),
- Print => "print".to_string(),
Let => "let".to_string(),
Nil => "()".to_string(),
})
diff --git a/src/sexp/mod.rs b/src/sexp/mod.rs
index c674ee9..7aa517b 100644
--- a/src/sexp/mod.rs
+++ b/src/sexp/mod.rs
@@ -33,8 +33,6 @@ pub enum SLeaf {
Let,
- Print,
-
Int(i32),
True,
False,
@@ -71,7 +69,7 @@ impl SExp {
SCons(a, b) =>
SCons(a.clone(), b.clone()).check_let().is_some() ||
(
- (**a == Atom(Quote) || **a == Atom(Vector) || **a == Atom(Print))
+ (**a == Atom(Quote) || **a == Atom(Vector))
&& b.consists_of_values()
),
Atom(Var(_)) => false,
diff --git a/src/sexp/step.rs b/src/sexp/step.rs
index 94f6381..816582c 100644
--- a/src/sexp/step.rs
+++ b/src/sexp/step.rs
@@ -309,21 +309,6 @@ impl SExp {
None => panic!("unreachable as per match guard arm"),
},
- // prints
- SCons(op, l) if op.clone().is_print() => match *op {
- SCons(_, b) => {
- println!("{}", match *b {
- SCons(a, b) if *b == Atom(Nil) => *a,
- t => t,
- });
- Ok(match *l {
- SCons(a, b) if *b == Atom(Nil) => *a,
- t => t
- })
- },
- Atom(_) => panic!("unreachable as per match arm guard"),
- },
-
// op value and a1 .. an values, and b0, b1 .. bn not values
// ---------------------------------------------------------
diff --git a/src/sexp/util.rs b/src/sexp/util.rs
index 507455f..a28aaad 100644
--- a/src/sexp/util.rs
+++ b/src/sexp/util.rs
@@ -86,11 +86,4 @@ impl SExp {
_ => None
}
}
-
- pub fn is_print(&self) -> bool {
- match self {
- SCons(op, _) if **op == Atom(Print) => true,
- _ => false
- }
- }
}