fn with_compiler(
    source_path: String,
    optimize: u8,
    f: impl FnOnce(&mut Compiler) -> Result<(), CompileError>,
) -> Result<CodeObject, CompileError> {
    let mut compiler = Compiler::new(optimize);
    compiler.source_path = Some(source_path);
    compiler.push_new_code_object("<module>".to_string());
    f(&mut compiler)?;
    let code = compiler.pop_code_object();
    trace!("Compilation completed: {:?}", code);
    Ok(code)
}
/// A helper function for the shared code of the different compile functions
A helper function for the shared code of the different compile functions
A helper function for the shared code of the different compile functions
fn with_compiler(
    source_path: String,
    optimize: u8,
    f: impl FnOnce(&mut Compiler) -> Result<(), CompileError>,
) -> Result<CodeObject, CompileError> {
    let mut compiler = Compiler::new(optimize);
    compiler.source_path = Some(source_path);
    compiler.push_new_code_object("<module>".to_string());
    f(&mut compiler)?;
    let code = compiler.pop_code_object();
    trace!("Compilation completed: {:?}", code);
    Ok(code)
}
fn with_compiler ( source_path : String , optimize : u8 , f : impl FnOnce ( & mut Compiler ) -> Result < ( ) , CompileError > , ) -> Result < CodeObject , CompileError > { let mut compiler = Compiler :: new ( optimize ) ; compiler . source_path = Some ( source_path ) ; compiler . push_new_code_object ( " " . to_string ( ) ) ; f ( & mut compiler ) ? ; let code = compiler . pop_code_object ( ) ; trace ! ( " " code ) ; Ok ( code ) }
A helper function for the shared code of the different compile functions
A helper function for the shared code of the different compile functions
source_path
String
optimize
u8
f
impl FnOnce(&mut Compiler) -> Result<(), CompileError>