diff options
Diffstat (limited to 'src/sexp/step.rs')
-rw-r--r-- | src/sexp/step.rs | 8 |
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() + } + } } |