diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-10-31 12:40:21 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-10-31 12:40:21 -0300 |
commit | 94b73c41c6985e511806dbb43702ff85e8da4513 (patch) | |
tree | 92bf2a67c41357ad013b19a3a7b99ab7880d210b /src/vm/mod.rs | |
parent | 6fac8900d19b9406229e5bf2b36fbfbbdfe548d4 (diff) |
Finish step_out
Diffstat (limited to 'src/vm/mod.rs')
-rw-r--r-- | src/vm/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vm/mod.rs b/src/vm/mod.rs index 131e48a..2e9d796 100644 --- a/src/vm/mod.rs +++ b/src/vm/mod.rs @@ -525,6 +525,22 @@ impl<'pat> Frame<'pat> { } } + /// Returns this value subtree, as an `(index, optional)` pair. + /// + /// # Panics + /// + /// Panics if iteration hasn't begun, or this isn't a value subtree. + fn value_subtree(&self) -> (usize, bool) { + if let PatternElement::ValueSubtree { + index, + optional, + } = self.raw_op() { + (index, optional) + } else { + unreachable!() + } + } + /// Returns the raw instruction. /// /// # Panics |