diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-01-20 23:45:47 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-01-20 23:45:47 +0100 |
| commit | 9626aa05496a0e745252ba30bf64e8d020c6ec2a (patch) | |
| tree | 304aa1d456caf826ba13370978a9fb7ef79a2b2e | |
| parent | f663999eccd693ddbfd581a51213b816c461f092 (diff) | |
| download | sylt-9626aa05496a0e745252ba30bf64e8d020c6ec2a.tar.gz | |
cleanup
| -rw-r--r-- | src/compiler.rs | 8 | ||||
| -rw-r--r-- | src/vm.rs | 3 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index aca1b26..d72b8d3 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -143,7 +143,6 @@ impl Frame { } fn add_upvalue(&mut self, variable: Variable) -> Variable { - println!("{} - UPDOG", variable.name); let new_variable = Variable { outer_upvalue: variable.upvalue, outer_slot: variable.slot, @@ -552,9 +551,6 @@ impl Compiler { for var in self.frame().upvalues.iter() { function_block.ups.push((var.outer_slot, var.outer_upvalue, var.typ.clone())); } - println!("{:?}", function_block.ups); - // TODO(ed): Send the original place to find the upvalues, - // so we know from where to copy them. }); for op in function_block.ops.iter().rev() { @@ -586,7 +582,7 @@ impl Compiler { fn variable_expression(&mut self, block: &mut Block) { let name = match self.eat() { Token::Identifier(name) => name, - __ => unreachable!(), + _ => unreachable!(), }; if let Some(var) = self.find_variable(&name) { if var.upvalue { @@ -602,7 +598,7 @@ impl Compiler { } } - fn define_variable(&mut self, name: &str, typ: Type, block: &mut Block) -> Result<usize, ()> { + fn define_variable(&mut self, name: &str, typ: Type, _block: &mut Block) -> Result<usize, ()> { if let Some(var) = self.find_variable(&name) { if var.scope == self.frame().scope { error!(self, format!("Multiple definitions of {} in this block.", name)); @@ -373,7 +373,6 @@ impl VM { let value = match value { Value::Function(_, block) => { let mut ups = Vec::new(); - println!("UPS: {:?}", block.ups); for (slot, is_up, _) in block.ups.iter() { let up = if *is_up { if let Value::Function(local_ups, _) = &self.stack[offset] { @@ -743,7 +742,7 @@ impl VM { self.frames.push(Frame { stack_offset: 0, - block: block, + block, ip: 0 }); |
