diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 12:08:23 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-05 12:08:23 +0300 |
commit | bf458367d77cb4ca3f4ac0a4a8c9ffe13f71b09b (patch) | |
tree | 4019d2a46cf2c74dadd773aaa510a3867889a194 /src/sexp/util.rs | |
parent | c629fac4297b8f13bdab00100f3b05549174154e (diff) | |
download | myslip-bf458367d77cb4ca3f4ac0a4a8c9ffe13f71b09b.tar.gz myslip-bf458367d77cb4ca3f4ac0a4a8c9ffe13f71b09b.zip |
Implemented booleans (no if-else yet)
Diffstat (limited to 'src/sexp/util.rs')
-rw-r--r-- | src/sexp/util.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sexp/util.rs b/src/sexp/util.rs index f01dab9..b3edf19 100644 --- a/src/sexp/util.rs +++ b/src/sexp/util.rs @@ -12,6 +12,12 @@ impl From<i32> for Box<SExp> { } } +impl From<bool> for SExp { + fn from(bl: bool) -> Self { + Atom( if bl { True } else { False } ) + } +} + impl From<SLeaf> for Box<SExp> { fn from(leaf: SLeaf) -> Self { Box::new(Atom(leaf)) |