diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-29 21:05:10 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-29 21:05:10 -0500 |
commit | ace046624d2e23fba67564a86af7f03ed8a48eae (patch) | |
tree | 21ae64bc5897b1b89ee2ab8563b0e7ce047bf34a /matrix-lang/src/compiler.rs | |
parent | fix readme (diff) | |
download | matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.tar.gz matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.tar.bz2 matrix-ace046624d2e23fba67564a86af7f03ed8a48eae.zip |
remove unwraps, fix utf8
Diffstat (limited to 'matrix-lang/src/compiler.rs')
-rw-r--r-- | matrix-lang/src/compiler.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/matrix-lang/src/compiler.rs b/matrix-lang/src/compiler.rs index 95c6ccf..da1ecf7 100644 --- a/matrix-lang/src/compiler.rs +++ b/matrix-lang/src/compiler.rs @@ -142,7 +142,7 @@ impl<'c> Compiler<'c> { fn collapse_scopes(&mut self, top_scope: usize) { let mut cutoff = usize::MAX; while self.scopes.len() > top_scope { - cutoff = self.scopes.pop().unwrap() + cutoff = self.scopes.pop().expect("bypassed compiler scope check") } if cutoff < self.locals.len() { self.emit(Instruction::DiscardLocals((self.locals.len() - cutoff) as u16), self.last_pos()); |