#[derive(Debug)]
pub struct AngularFor<'s> {
pub binding: (&'s str, usize),
pub expr: (&'s str, usize),
pub track: Option<(&'s str, usize)>,
pub aliases: Vec<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
pub empty: Option<Vec<Node<'s>>>,
}
#[derive(Debug)]
pub struct AngularIf<'s> {
pub expr: (&'s str, usize),
pub reference: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
pub else_if_blocks: Vec<AngularElseIf<'s>>,
pub else_children: Option<Vec<Node<'s>>>,
}
#[derive(Debug)]
pub struct AngularElseIf<'s> {
pub expr: (&'s str, usize),
pub reference: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct AngularGenericBlock<'s> {
pub keyword: &'s str,
pub header: Option<&'s str>,
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct AngularInterpolation<'s> {
pub expr: &'s str,
pub start: usize,
}
#[derive(Debug)]
pub struct AngularLet<'s> {
pub name: &'s str,
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct AngularSwitch<'s> {
pub expr: (&'s str, usize),
pub arms: Vec<AngularSwitchArm<'s>>,
}
#[derive(Debug)]
pub struct AngularSwitchArm<'s> {
pub keyword: &'static str,
pub expr: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct AstroAttribute<'s> {
pub name: Option<&'s str>,
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct AstroExpr<'s> {
pub children: Vec<AstroExprChild<'s>>,
pub has_line_comment: bool,
pub start: usize,
}
#[derive(Debug)]
pub enum AstroExprChild<'s> {
Script(&'s str),
Template(Vec<Node<'s>>),
}
#[derive(Debug)]
pub enum Attribute<'s> {
Astro(AstroAttribute<'s>),
JinjaBlock(JinjaBlock<'s, Attribute<'s>>),
JinjaComment(JinjaComment<'s>),
JinjaTag(JinjaTag<'s>),
JsComment(JsComment<'s>),
Native(NativeAttribute<'s>),
Svelte(SvelteAttribute<'s>),
SvelteAttachment(SvelteAttachment<'s>),
VentoTagOrBlock(NodeKind<'s>),
VueDirective(VueDirective<'s>),
}
#[derive(Debug)]
pub struct Cdata<'s> {
pub raw: &'s str,
}
#[derive(Debug)]
pub struct Comment<'s> {
pub raw: &'s str,
}
#[derive(Debug)]
pub struct Doctype<'s> {
pub keyword: &'s str,
pub value: &'s str,
}
#[derive(Debug)]
pub struct Element<'s> {
pub tag_name: &'s str,
pub attrs: Vec<Attribute<'s>>,
pub first_attr_same_line: bool,
pub children: Vec<Node<'s>>,
pub self_closing: bool,
pub void_element: bool,
}
#[derive(Debug)]
pub struct FrontMatter<'s> {
pub raw: &'s str,
pub start: usize,
}
#[derive(Debug)]
pub struct JinjaBlock<'s, T> {
pub body: Vec<JinjaTagOrChildren<'s, T>>,
}
#[derive(Debug)]
pub struct JinjaComment<'s> {
pub raw: &'s str,
}
#[derive(Debug)]
pub struct JinjaInterpolation<'s> {
pub expr: &'s str,
pub start: usize,
pub trim_prev: bool,
pub trim_next: bool,
}
#[derive(Debug)]
pub struct JinjaTag<'s> {
pub content: &'s str,
pub start: usize,
}
#[derive(Debug)]
pub enum JinjaTagOrChildren<'s, T> {
Tag(JinjaTag<'s>),
Children(Vec<T>),
}
#[derive(Debug)]
pub struct JsComment<'s> {
pub block: bool,
pub raw: &'s str,
}
#[derive(Debug)]
pub struct MustacheBlock<'s> {
pub controls: Vec<MustacheBlockControl<'s>>,
pub children: Vec<Vec<Node<'s>>>,
}
#[derive(Debug)]
pub struct MustacheBlockControl<'s> {
pub name: &'s str,
pub prefix: &'s str,
pub content: Option<&'s str>,
pub wc_before: bool,
pub wc_after: bool,
}
#[derive(Debug)]
pub struct MustacheInterpolation<'s> {
pub content: &'s str,
}
#[derive(Debug)]
pub struct NativeAttribute<'s> {
pub name: &'s str,
pub value: Option<(&'s str, usize)>,
pub quote: Option<char>,
}
#[derive(Debug)]
pub struct Node<'s> {
pub kind: NodeKind<'s>,
pub raw: &'s str,
}
#[derive(Debug)]
pub enum NodeKind<'s> {
AngularFor(AngularFor<'s>),
AngularGenericBlocks(Vec<AngularGenericBlock<'s>>),
AngularIf(AngularIf<'s>),
AngularInterpolation(AngularInterpolation<'s>),
AngularLet(AngularLet<'s>),
AngularSwitch(AngularSwitch<'s>),
AstroExpr(AstroExpr<'s>),
Cdata(Cdata<'s>),
Comment(Comment<'s>),
Doctype(Doctype<'s>),
Element(Element<'s>),
FrontMatter(FrontMatter<'s>),
JinjaBlock(JinjaBlock<'s, Node<'s>>),
JinjaComment(JinjaComment<'s>),
JinjaInterpolation(JinjaInterpolation<'s>),
JinjaTag(JinjaTag<'s>),
MustacheBlock(MustacheBlock<'s>),
MustacheInterpolation(MustacheInterpolation<'s>),
SvelteAtTag(SvelteAtTag<'s>),
SvelteAwaitBlock(Box<SvelteAwaitBlock<'s>>),
SvelteEachBlock(SvelteEachBlock<'s>),
SvelteIfBlock(SvelteIfBlock<'s>),
SvelteInterpolation(SvelteInterpolation<'s>),
SvelteKeyBlock(SvelteKeyBlock<'s>),
SvelteSnippetBlock(SvelteSnippetBlock<'s>),
Text(TextNode<'s>),
VentoBlock(VentoBlock<'s>),
VentoComment(VentoComment<'s>),
VentoEval(VentoEval<'s>),
VentoInterpolation(VentoInterpolation<'s>),
VentoTag(VentoTag<'s>),
VueInterpolation(VueInterpolation<'s>),
XmlDecl(XmlDecl<'s>),
}
#[derive(Debug)]
pub struct Root<'s> {
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct SvelteAtTag<'s> {
pub name: &'s str,
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct SvelteAttribute<'s> {
pub name: Option<&'s str>,
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct SvelteAttachment<'s> {
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct SvelteAwaitBlock<'s> {
pub expr: (&'s str, usize),
pub then_binding: Option<Option<(&'s str, usize)>>, pub catch_binding: Option<Option<(&'s str, usize)>>, pub children: Vec<Node<'s>>,
pub then_block: Option<SvelteThenBlock<'s>>,
pub catch_block: Option<SvelteCatchBlock<'s>>,
}
#[derive(Debug)]
pub struct SvelteCatchBlock<'s> {
pub binding: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct SvelteThenBlock<'s> {
pub binding: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct SvelteEachBlock<'s> {
pub expr: (&'s str, usize),
pub binding: Option<(&'s str, usize)>,
pub index: Option<&'s str>,
pub key: Option<(&'s str, usize)>,
pub children: Vec<Node<'s>>,
pub else_children: Option<Vec<Node<'s>>>,
}
#[derive(Debug)]
pub struct SvelteIfBlock<'s> {
pub expr: (&'s str, usize),
pub children: Vec<Node<'s>>,
pub else_if_blocks: Vec<SvelteElseIfBlock<'s>>,
pub else_children: Option<Vec<Node<'s>>>,
}
#[derive(Debug)]
pub struct SvelteElseIfBlock<'s> {
pub expr: (&'s str, usize),
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct SvelteInterpolation<'s> {
pub expr: (&'s str, usize),
}
#[derive(Debug)]
pub struct SvelteKeyBlock<'s> {
pub expr: (&'s str, usize),
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct SvelteSnippetBlock<'s> {
pub signature: (&'s str, usize),
pub children: Vec<Node<'s>>,
}
#[derive(Debug)]
pub struct TextNode<'s> {
pub raw: &'s str,
pub line_breaks: usize,
pub start: usize,
}
#[derive(Debug)]
pub struct VentoBlock<'s> {
pub body: Vec<VentoTagOrChildren<'s>>,
}
#[derive(Debug)]
pub struct VentoComment<'s> {
pub raw: &'s str,
}
#[derive(Debug)]
pub struct VentoEval<'s> {
pub raw: &'s str,
pub start: usize,
}
#[derive(Debug)]
pub struct VentoInterpolation<'s> {
pub expr: &'s str,
pub start: usize,
pub trim_prev: bool,
pub trim_next: bool,
}
#[derive(Debug)]
pub struct VentoTag<'s> {
pub tag: &'s str,
pub trim_prev: bool,
pub trim_next: bool,
}
#[derive(Debug)]
pub enum VentoTagOrChildren<'s> {
Tag(VentoTag<'s>),
Children(Vec<Node<'s>>),
}
#[derive(Debug)]
pub struct VueDirective<'s> {
pub name: &'s str,
pub arg_and_modifiers: Option<&'s str>,
pub value: Option<(&'s str, usize)>,
}
#[derive(Debug)]
pub struct VueInterpolation<'s> {
pub expr: &'s str,
pub start: usize,
}
#[derive(Debug)]
pub struct XmlDecl<'s> {
pub attrs: Vec<NativeAttribute<'s>>,
}