mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-28 12:45:26 +03:00
Refactor to previous function name:
This commit is contained in:
parent
798c3f0eb6
commit
a9746cb756
@ -109,7 +109,7 @@ impl Ast {
|
||||
}
|
||||
|
||||
/// Serializes the ast into a JSON file.
|
||||
pub fn to_json_file_direct(&self, mut path: std::path::PathBuf, file_name: &str) -> Result<()> {
|
||||
pub fn to_json_file(&self, mut path: std::path::PathBuf, file_name: &str) -> Result<()> {
|
||||
path.push(file_name);
|
||||
let file = std::fs::File::create(&path).map_err(|e| AstError::failed_to_create_ast_json_file(&path, &e))?;
|
||||
let writer = std::io::BufWriter::new(file);
|
||||
|
@ -251,7 +251,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> Compiler<'a, F, G> {
|
||||
remove_key_from_json(&mut value, "span");
|
||||
write_value_to_json_file(value, self.output_directory.clone(), "initial_ast.json")?;
|
||||
} else {
|
||||
ast.to_json_file_direct(self.output_directory.clone(), "initial_ast.json")?;
|
||||
ast.to_json_file(self.output_directory.clone(), "initial_ast.json")?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> Compiler<'a, F, G> {
|
||||
remove_key_from_json(&mut value, "span");
|
||||
write_value_to_json_file(value, self.output_directory.clone(), "imports_resolved_ast.json")?;
|
||||
} else {
|
||||
ast.to_json_file_direct(self.output_directory.clone(), "imports_resolved_ast.json")?;
|
||||
ast.to_json_file(self.output_directory.clone(), "imports_resolved_ast.json")?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> Compiler<'a, F, G> {
|
||||
remove_key_from_json(&mut value, "span");
|
||||
write_value_to_json_file(value, self.output_directory.clone(), "canonicalization_ast.json")?;
|
||||
} else {
|
||||
ast.to_json_file_direct(self.output_directory.clone(), "canonicalization_ast.json")?;
|
||||
ast.to_json_file(self.output_directory.clone(), "canonicalization_ast.json")?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> Compiler<'a, F, G> {
|
||||
remove_key_from_json(&mut value, "span");
|
||||
write_value_to_json_file(value, self.output_directory.clone(), "type_inferenced_ast.json")?;
|
||||
} else {
|
||||
new_ast.to_json_file_direct(self.output_directory.clone(), "type_inferenced_ast.json")?;
|
||||
new_ast.to_json_file(self.output_directory.clone(), "type_inferenced_ast.json")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user