Code gen support

This commit is contained in:
Pranav Gaddamadugu 2023-08-03 00:46:09 -04:00
parent daf003f728
commit 023d94d20f

View File

@ -422,6 +422,18 @@ impl<'a> CodeGenerator<'a> {
.expect("failed to write to string"); .expect("failed to write to string");
(destination_register, instruction) (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"), _ => unreachable!("All core functions should be known at this phase of compilation"),
}; };
// Add the instruction to the list of instructions. // Add the instruction to the list of instructions.