use super::{NativeChildren, NativeComponent};
use crate::markup::ComponentSourceError;
use vize_l0::{Allocator, SourceBlock};
pub struct NativeLintComponent<'a> {
component: NativeComponent<'a>,
}
impl core::fmt::Debug for NativeLintComponent<'_> {
fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
formatter
.debug_struct("NativeLintComponent")
.field("component", &self.component)
.finish_non_exhaustive()
}
}
impl<'a> NativeLintComponent<'a> {
pub fn parse_in(
allocator: &'a Allocator,
block: SourceBlock<'a>,
) -> Result<Self, ComponentSourceError> {
Ok(Self {
component: NativeComponent::parse_lint_in(allocator, block)?,
})
}
#[must_use]
pub fn component(&self) -> &NativeComponent<'a> {
&self.component
}
#[must_use]
pub fn children(&self) -> NativeChildren<'_, 'a> {
self.component.children()
}
}