use super::expr::{CommandCall, Expr, ExprKind};
use super::span::Spanned;
#[derive(Debug, Clone)]
pub struct Template {
pub nodes: Vec<Node>,
}
pub type Node = Spanned<NodeKind>;
#[derive(Debug, Clone)]
pub enum NodeKind {
Literal(String),
Expression(ExprKind),
Command(CommandCall),
IfBlock(IfBlock),
ForEach(ForEachBlock),
}
#[derive(Debug, Clone)]
pub struct IfBlock {
pub condition: Expr,
pub body: Template,
pub elif_branches: Vec<ElifBranch>,
pub else_body: Option<Template>,
}
#[derive(Debug, Clone)]
pub struct ElifBranch {
pub condition: Expr,
pub body: Template,
}
#[derive(Debug, Clone)]
pub struct ForEachBlock {
pub binding: String,
pub iterable: Expr,
pub body: Template,
}