Connect compiler

This commit is contained in:
Pranav Gaddamadugu 2023-09-28 16:27:58 -04:00
parent 05481218bf
commit 9d3fcc70f1
3 changed files with 3 additions and 3 deletions

View File

@ -259,7 +259,7 @@ impl<'a> Compiler<'a> {
struct_graph: &StructGraph,
call_graph: &CallGraph,
) -> Result<String> {
CodeGenerator::do_pass((&self.ast, symbol_table, struct_graph, call_graph))
CodeGenerator::do_pass((&self.ast, symbol_table, struct_graph, call_graph, &self.ast.ast))
}
/// Runs the compiler stages.

View File

@ -241,7 +241,7 @@ pub fn compile_and_process<'a>(parsed: &'a mut Compiler<'a>) -> Result<String, L
parsed.dead_code_elimination_pass()?;
// Compile Leo program to bytecode.
let bytecode = CodeGenerator::do_pass((&parsed.ast, &st, &struct_graph, &call_graph))?;
let bytecode = CodeGenerator::do_pass((&parsed.ast, &st, &struct_graph, &call_graph, &parsed.ast.ast))?;
Ok(bytecode)
}

View File

@ -548,7 +548,7 @@ impl<'a> CodeGenerator<'a> {
self.next_register += 1;
// Construct the future type.
let program_id = match input.external.as_ref().and_then(|expression| Some(&**expression)) {
let program_id = match input.external.as_deref() {
Some(Expression::Identifier(identifier)) => identifier,
_ => unreachable!("If `has_finalize` is true, then the external call must be an identifier."),
};