From 023d94d20f73b76894f8185089bed8bb1ddb0be6 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 3 Aug 2023 00:46:09 -0400 Subject: [PATCH] Code gen support --- .../passes/src/code_generation/visit_expressions.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/passes/src/code_generation/visit_expressions.rs b/compiler/passes/src/code_generation/visit_expressions.rs index db67c79fe7..e23632e821 100644 --- a/compiler/passes/src/code_generation/visit_expressions.rs +++ b/compiler/passes/src/code_generation/visit_expressions.rs @@ -422,6 +422,18 @@ impl<'a> CodeGenerator<'a> { .expect("failed to write to string"); (destination_register, instruction) } + Type::Identifier(Identifier { name: sym::signature, .. }) => { + let mut instruction = " sign.verify".to_string(); + let destination_register = get_destination_register(); + // Write the arguments and the destination register. + writeln!( + instruction, + " {} {} {} into {destination_register};", + arguments[0], arguments[1], arguments[2] + ) + .expect("failed to write to string"); + (destination_register, instruction) + } _ => unreachable!("All core functions should be known at this phase of compilation"), }; // Add the instruction to the list of instructions.