use std::collections::HashMap;
use std::ops::Range;
use assura_parser::ast::{
BinOp, ClauseKind, Decl, Expr, ExprVisitor, Literal, ServiceItem, SpExpr, UnaryOp,
};
use crate::{Type, TypeEnv, TypeError};
#[derive(Debug, Clone)]
pub(crate) struct CheckerError {
pub code: assura_diagnostics::ErrorCode,
pub message: String,
pub span: Range<usize>,
}
impl CheckerError {
pub fn with_context(self, context: &str) -> Self {
Self {
message: format!("{context}: {}", self.message),
..self
}
}
}
impl From<CheckerError> for TypeError {
fn from(e: CheckerError) -> Self {
TypeError {
code: e.code,
message: e.message,
span: e.span,
secondary: None,
suggestion: None,
}
}
}
mod effects;
mod error_propagation;
mod ffi;
mod fixed_width;
mod frame;
mod info_flow;
mod interface;
mod linear;
mod memory;
mod security;
mod taint;
mod totality;
mod typestate;
pub(crate) use effects::*;
pub(crate) use error_propagation::*;
pub(crate) use ffi::*;
pub(crate) use fixed_width::*;
pub(crate) use frame::*;
pub(crate) use info_flow::*;
pub(crate) use interface::*;
pub(crate) use linear::*;
pub(crate) use memory::*;
pub(crate) use security::*;
pub(crate) use taint::*;
pub(crate) use totality::*;
pub(crate) use typestate::*;
pub use error_propagation::FrameChecker;
pub use memory::expr_references_var;
pub use taint::TaintLabel;
pub use totality::PendingDecreaseCheck;