a42429012e
- crates/ → engrams/ (Rust engrams live here)
- el-compiler/ added: el self-hosting compiler as an el package
- src/{compiler,lexer,parser,codegen}.el
- bootstrap/el-compiler.elc (114KB, Rust-compiled seed)
- el.toml Cargo.toml workspace paths updated
- neuron-rs cross-repo path deps fixed (were pointing to products/ instead of foundation/)
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
//! Diagnostic types for the architectural checker.
|
|
|
|
/// Severity level of an architectural diagnostic.
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
pub enum Severity {
|
|
Error,
|
|
Warning,
|
|
}
|
|
|
|
/// A single architectural diagnostic (error or warning).
|
|
#[derive(Debug, Clone)]
|
|
pub struct ArchDiagnostic {
|
|
pub severity: Severity,
|
|
/// Rule identifier, e.g. "VBD-001".
|
|
pub rule: String,
|
|
pub message: String,
|
|
/// Function name or other location hint.
|
|
pub location: Option<String>,
|
|
}
|
|
|
|
/// Type alias — an ArchError is an ArchDiagnostic with Severity::Error.
|
|
pub type ArchError = ArchDiagnostic;
|
|
|
|
/// Type alias — an ArchWarning is an ArchDiagnostic with Severity::Warning.
|
|
pub type ArchWarning = ArchDiagnostic;
|
|
|
|
impl ArchDiagnostic {
|
|
pub fn error(rule: impl Into<String>, message: impl Into<String>, location: Option<String>) -> Self {
|
|
Self {
|
|
severity: Severity::Error,
|
|
rule: rule.into(),
|
|
message: message.into(),
|
|
location,
|
|
}
|
|
}
|
|
|
|
pub fn warning(rule: impl Into<String>, message: impl Into<String>, location: Option<String>) -> Self {
|
|
Self {
|
|
severity: Severity::Warning,
|
|
rule: rule.into(),
|
|
message: message.into(),
|
|
location,
|
|
}
|
|
}
|
|
}
|