mirror of
https://github.com/AleoHQ/leo.git
synced 2024-09-21 12:07:56 +03:00
Connect compiler
This commit is contained in:
parent
05481218bf
commit
9d3fcc70f1
@ -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.
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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."),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user