use std::{path::Path, sync::Arc};
use crate::{
Diagnostic,
ir::{AttributeMap, BlockKind, ComponentKind, Span},
};
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct RawBlock {
pub kind: BlockKind,
pub labels: Vec<Arc<str>>,
pub body: AttributeMap,
pub span: Span,
pub source: Arc<Path>,
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct RawComponent {
pub path: Arc<Path>,
pub kind: ComponentKind,
pub raw_blocks: Vec<RawBlock>,
pub diagnostics: Vec<Diagnostic>,
}
impl RawComponent {
#[must_use]
pub fn new(path: Arc<Path>, kind: ComponentKind) -> Self {
Self {
path,
kind,
raw_blocks: Vec::new(),
diagnostics: Vec::new(),
}
}
}