use crate::{syntax::NodeKind, tokens::TokenKind};
#[derive(Debug, Copy, Clone)]
pub enum Layout {
Sequence(Sequence),
Choice(Choice),
}
#[derive(Debug, Copy, Clone)]
pub struct Sequence {
pub kind: NodeKind,
pub items: &'static [LayoutItem],
}
#[derive(Debug, Copy, Clone)]
pub struct Choice {
pub options: &'static [NodeKind],
}
#[derive(Debug, Copy, Clone)]
pub struct LayoutItem {
pub optional: bool,
pub repeated: bool,
pub name: &'static str,
pub kind: LayoutItemKind,
}
#[derive(Debug, Copy, Clone)]
pub enum LayoutItemKind {
Token(TokenKind),
Node(NodeKind),
NodeChoice(&'static [NodeKind]),
TokenChoice(&'static [TokenKind]),
}