aboutsummaryrefslogtreecommitdiff
path: root/src/sexp/display.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-09 21:39:45 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-09 21:39:45 +0300
commita2ca4c08dcbb5c08e210bc741141290a136a8de4 (patch)
tree17e35daeb7028b61b3afb2a9a626bcf38a3dfbff /src/sexp/display.rs
parent8062ed87d30fa7628f26cfd7bb94bb0e7401752b (diff)
downloadmyslip-a2ca4c08dcbb5c08e210bc741141290a136a8de4.tar.gz
myslip-a2ca4c08dcbb5c08e210bc741141290a136a8de4.zip
Implemented print as ? -> ()
Diffstat (limited to 'src/sexp/display.rs')
-rw-r--r--src/sexp/display.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sexp/display.rs b/src/sexp/display.rs
index c3db144..a978f61 100644
--- a/src/sexp/display.rs
+++ b/src/sexp/display.rs
@@ -27,6 +27,7 @@ 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(),
})
@@ -40,6 +41,7 @@ impl fmt::Display for SExp {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Atom(leaf) => write!(f, "{}", leaf.to_string()),
+ SCons(a, b) if **b == Atom(Nil) => (*a).fmt(f),
SCons(a, b) =>
write!(
f,