Skip to main content

check_recovered_source_with_environment

Function check_recovered_source_with_environment 

Source
pub fn check_recovered_source_with_environment(
    source: &SourceId,
    environment: &AdamCheckingEnvironment,
    availability: MetadataAvailability,
) -> ModuleCheckingReport
Expand description

Checks recovered source bodies without resolving or certifying component composition.

Retains every recovered syntax error and independently decidable body error. Imports and component uses remain unresolved; the report always marks composition incomplete. Every label retains the supplied immutable source owner. No runtime lowering, value construction, or host callback participates in checking.

  • Complexity: Module parsing plus expression checking and compact local graph validation as specified by check_module_with_environment, plus retained source diagnostics; no composed dependency expansion.

ยงExamples

use adam_lang::{SourceMap, check_recovered_source_with_environment};
use cel_parser::checking::MetadataAvailability;
let source = SourceMap::new().insert("app.adm2",
    "sheet app { cell x: i32 = true; cell y malformed; }");
let environment = adam_lang::checking_environment(
    &adam_lang::TypeRegistry::new(), &cel_parser::OpLookup::new()).unwrap();
let report = check_recovered_source_with_environment(
    &source, &environment, MetadataAvailability::Complete);
assert_eq!(report.diagnostics.len(), 2);
assert!(!report.incomplete.is_empty());