aboutsummaryrefslogtreecommitdiff
path: root/src/sexp/step.rs
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-04 23:50:46 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-08-04 23:50:46 +0300
commitfdae943090463526423f5e43e72cd2f0e8147a1b (patch)
tree5a7212555d8511df16fe6bbcc54b863ec9463b46 /src/sexp/step.rs
parent36d2818d39e61b752923e253f8455f50510cb428 (diff)
downloadmyslip-fdae943090463526423f5e43e72cd2f0e8147a1b.tar.gz
myslip-fdae943090463526423f5e43e72cd2f0e8147a1b.zip
Added repl and some documentation. Improved error messages. Removed dead code.
* Removed same_variant in parse::parsetree * Added SExp::multistep (for use of the repl) Improved error messages: * Added parenthesis around types * Changed how errors propagate inferring generics: added the error variant ArgumentsDontMatchGeneric, implemented the displaying of it, added tests for it. * Had to change some tests to match for the new changes
Diffstat (limited to 'src/sexp/step.rs')
-rw-r--r--src/sexp/step.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sexp/step.rs b/src/sexp/step.rs
index 765e33c..1ab0291 100644
--- a/src/sexp/step.rs
+++ b/src/sexp/step.rs
@@ -209,4 +209,12 @@ impl SExp {
t => Err(format!("unimplemented: {:?}.step()", t)),
}
}
+
+
+ pub fn multistep(self) -> Result<Self, String> {
+ match self.clone().step()? {
+ x if x == self => Ok(self),
+ x => x.multistep()
+ }
+ }
}