//! Intermediate Representation (IR) - Validated error definition model
//!
//! This module defines the typed, validated representation of an error definition
//! after parsing from the AST. The IR is used by the code generator to produce
//! the final trait implementations.

mod enum_def;
mod field;
mod format_string;
mod http_status;
mod struct_def;
mod variant;

pub(crate) use enum_def::EnumDefinition;
pub(crate) use field::FieldDefinition;
pub(crate) use field::TransparentFieldDefinition;
pub(crate) use http_status::HttpStatusValue;
pub(crate) use struct_def::StructDefinition;
pub(crate) use variant::{
    RegularVariantDefinition, TransparentVariantDefinition, VariantDefinition,
};

/// Top-level error definition - either an enum or a struct
#[derive(Debug, Clone)]
pub(crate) enum Definition {
    /// An enum error with multiple variants
    Enum(EnumDefinition),

    /// A struct error (single-variant)
    Struct(StructDefinition),
}
