pub fn compile_prepared_db(
    db: &mut RootDatabase,
    main_crate_ids: Vec<CrateId>,
    compiler_config: CompilerConfig<'_>
) -> Result<Program>
Expand description

Runs Cairo compiler.

§Arguments

  • db - Preloaded compilation database.
  • main_crate_ids - CrateIds to compile. Do not include dependencies here, only pass top-level crates in order to eliminate unused code. Use db.intern_crate(CrateLongId::Real(name)) in order to obtain CrateId from its name.
  • compiler_config - The compiler configuration.

§Returns

  • Ok(Program) - The compiled program.
  • Err(anyhow::Error) - Compilation failed.