mod ctx; mod dsp; pub use ctx::*; pub use dsp::*; use crate::io::CompilerMsg; pub trait Node: Sized { fn parse(ctx: &mut ParseCtx) -> Result; fn fmt(&self, f: &mut std::fmt::Formatter, ctx: DisplayCtx) -> std::fmt::Result; fn dsp(&self, ctx: DisplayCtx) -> NodeDsp<'_, Self> { NodeDsp { node: self, ctx } } fn new_dsp(&self) -> NodeDsp<'_, Self> { self.dsp(DisplayCtx { indent: 0 }) } }