Refactor to previous function name:

This commit is contained in:
Pranav Gaddamadugu 2021-09-21 09:32:31 -07:00
parent 798c3f0eb6
commit a9746cb756
2 changed files with 5 additions and 5 deletions

View File

@ -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);

View 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")?;
}
}