use knuffel::span::Span; use knuffel::traits::Decode; #[derive(knuffel_derive::Decode, Debug)] #[knuffel(span_type=knuffel::span::Span)] struct AstChildren { #[knuffel(children)] children: Vec>, } fn parse>(text: &str) -> T { let mut nodes: Vec = knuffel::parse("", text).unwrap(); assert_eq!(nodes.len(), 1); nodes.remove(0) } #[test] fn parse_node_span() { let item = parse::(r#"node {a; b;}"#); assert_eq!(item.children.len(), 2); }