mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-22 19:42:31 +00:00
Delete verify_stack_match
This commit is contained in:
parent
a76c4420fa
commit
664de9b285
2 changed files with 5 additions and 25 deletions
|
@ -187,24 +187,6 @@ impl<'a> CodeBuilder<'a> {
|
|||
VmSymbolState::Pushed { pushed_at }
|
||||
}
|
||||
|
||||
/// Verify if a sequence of symbols is at the top of the stack
|
||||
pub fn verify_stack_match(&self, symbols: &[Symbol]) -> bool {
|
||||
let current_stack = self.current_stack();
|
||||
let n_symbols = symbols.len();
|
||||
let stack_depth = current_stack.len();
|
||||
if n_symbols > stack_depth {
|
||||
return false;
|
||||
}
|
||||
let offset = stack_depth - n_symbols;
|
||||
|
||||
for (i, sym) in symbols.iter().enumerate() {
|
||||
if current_stack[offset + i] != *sym {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
|
||||
FUNCTION HEADER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue