pub fn run_to_yul<W: WriteColor>(error_writer: &mut W, mut options: Options) -> anyhow::Result<()> {
    // Run the model builder.
    let addrs = parse_addresses_from_options(options.named_address_mapping.clone())?;
    let env = run_model_builder_with_options(
        vec![(options.sources.clone(), addrs.clone())],
        vec![(options.dependencies.clone(), addrs)],
        ModelBuilderOptions::default(),
    )?;
    // If the model contains any errors, report them now and exit.
    check_errors(
        &env,
        &options,
        error_writer,
        "exiting with Move build errors",
    )?;
    let (_, content, abi_content) = Generator::run(&options, &env);
    check_errors(
        &env,
        &options,
        error_writer,
        "exiting with Yul generation errors",
    )?;
    if let Some(i) = options.output.rfind('.') {
        options.abi_output = format!("{}.abi.json", &options.output[..i]);
    }
    fs::write(options.output, &content)?;
    fs::write(options.abi_output, &abi_content)?;
    Ok(())
}
/// Run move-to-yul compiler and print errors to given writer.
Run move-to-yul compiler and print errors to given writer.
Run move - to - yul compiler and print errors to given writer .
pub fn run_to_yul<W: WriteColor>(error_writer: &mut W, mut options: Options) -> anyhow::Result<()> {
    // Run the model builder.
    let addrs = parse_addresses_from_options(options.named_address_mapping.clone())?;
    let env = run_model_builder_with_options(
        vec![(options.sources.clone(), addrs.clone())],
        vec![(options.dependencies.clone(), addrs)],
        ModelBuilderOptions::default(),
    )?;
    // If the model contains any errors, report them now and exit.
    check_errors(
        &env,
        &options,
        error_writer,
        "exiting with Move build errors",
    )?;
    let (_, content, abi_content) = Generator::run(&options, &env);
    check_errors(
        &env,
        &options,
        error_writer,
        "exiting with Yul generation errors",
    )?;
    if let Some(i) = options.output.rfind('.') {
        options.abi_output = format!("{}.abi.json", &options.output[..i]);
    }
    fs::write(options.output, &content)?;
    fs::write(options.abi_output, &abi_content)?;
    Ok(())
}
pub fn run_to_yul < W : WriteColor > ( error_writer : & mut W , mut options : Options ) -> anyhow :: Result < ( ) > { // Run the model builder. let addrs = parse_addresses_from_options ( options . named_address_mapping . clone ( ) ) ? ; let env = run_model_builder_with_options ( vec ! [ ( options sources clone ( ) addrs clone ( ) ) ] , vec ! [ ( options dependencies clone ( ) addrs ) ] , ModelBuilderOptions :: default ( ) , ) ? ; // If the model contains any errors, report them now and exit. check_errors ( & env , & options , error_writer , " " , ) ? ; let ( _ , content , abi_content ) = Generator :: run ( & options , & env ) ; check_errors ( & env , & options , error_writer , " " , ) ? ; if let Some ( i ) = options . output . rfind ( '.' ) { options . abi_output = format ! ( " " options output [ i ] ) ; } fs :: write ( options . output , & content ) ? ; fs :: write ( options . abi_output , & abi_content ) ? ; Ok ( ( ) ) }
Run move-to-yul compiler and print errors to given writer.
Run move - to - yul compiler and print errors to given writer .
error_writer
&mut W
options
Options