diff --git a/dust-lang/src/value/function.rs b/dust-lang/src/value/function.rs index 08f9089..a8d6345 100644 --- a/dust-lang/src/value/function.rs +++ b/dust-lang/src/value/function.rs @@ -4,23 +4,13 @@ use crate::FunctionType; use super::DustString; -#[derive(Clone, Debug, PartialEq, PartialOrd)] +#[derive(Clone, Debug, Default, PartialEq, PartialOrd)] pub struct Function { pub name: Option, pub r#type: FunctionType, pub prototype_index: u16, } -impl Default for Function { - fn default() -> Self { - Self { - name: None, - r#type: FunctionType::default(), - prototype_index: 0, - } - } -} - impl Display for Function { fn fmt(&self, f: &mut Formatter) -> fmt::Result { let mut type_string = self.r#type.to_string(); diff --git a/dust-lang/src/vm/action/mod.rs b/dust-lang/src/vm/action/mod.rs index e23bc54..d83c08a 100644 --- a/dust-lang/src/vm/action/mod.rs +++ b/dust-lang/src/vm/action/mod.rs @@ -213,11 +213,15 @@ impl Action { Operation::MULTIPLY => multiply, Operation::DIVIDE => divide, Operation::MODULO => modulo, + Operation::NEGATE => negate, + Operation::NOT => not, Operation::EQUAL => equal, Operation::LESS => less, Operation::LESS_EQUAL => less_equal, Operation::TEST => test, Operation::TEST_SET => test_set, + Operation::CALL => call, + Operation::CALL_NATIVE => call_native, Operation::JUMP => jump, Operation::RETURN => r#return, _ => todo!(), @@ -1320,19 +1324,19 @@ fn less_equal( } } -fn negate(_: InstructionFields, _: &mut Thread, _: &mut PointerCache) { +fn negate(_: &mut usize, _: InstructionFields, _: &mut Thread, _: &mut PointerCache) { todo!() } -fn not(_: InstructionFields, _: &mut Thread, _: &mut PointerCache) { +fn not(_: &mut usize, _: InstructionFields, _: &mut Thread, _: &mut PointerCache) { todo!() } -fn call(_: InstructionFields, _: &mut Thread, _: &mut PointerCache) { +fn call(_: &mut usize, _: InstructionFields, _: &mut Thread, _: &mut PointerCache) { todo!() } -fn call_native(_: InstructionFields, _: &mut Thread, _: &mut PointerCache) { +fn call_native(_: &mut usize, _: InstructionFields, _: &mut Thread, _: &mut PointerCache) { todo!() }