Skip to main content

prepare_translation_file

Function prepare_translation_file 

Source
pub fn prepare_translation_file(
    path: &Path,
    request: &RewriteRequest,
) -> Result<TranslationPublication, ApiError>
Expand description

Prepares a bounded PlusCal rewrite and cfg/backup updates without writing files. Source-option -noold/-nocfg settings are effective, and the existing default modified-body protection and TLC overwrite policy are retained.

use dive_api::{prepare_translation_file, RewriteRequest};
let pending = prepare_translation_file(std::path::Path::new("Algorithm.tla"), &RewriteRequest::default())?;
if pending.report().accepted() { let written = pending.publish()?; assert!(written.accepted()); }

ยงErrors

I/O or bounded/regular-file input errors. Translation failures remain reports.