#![feature(lint_reasons)]

#[macro_use]
pub mod util {
    macro_rules! gen_attr {
        ($name:literal = $out:expr) => {
            quick_xml::events::attributes::Attribute {
                key: quick_xml::name::QName($name),
                value: std::borrow::Cow::from(($out).to_string().into_bytes()),
            }
        };
    }

    macro_rules! gen_attrs {
        ($($name:literal: $out:expr),+) => {
            vec![
                $(gen_attr!($name = $out)),+
            ]
        };
        ($($cond:expr => $name:literal: $out:expr),+) => {
             {
                let mut r = Vec::new();
                $(if $cond {
                    r.push(gen_attr!($name = $out));
                })+
                r
            }
        };
        ($other:ident; $($cond:expr => $name:literal: $out:expr),+) => {
            $other.append(&mut gen_attrs![$($cond => $name: $out),+]);
        };
    }
}

pub mod codegen;
pub mod types;
pub use types::nodes::Node;

#[cfg(test)]
mod tests;
