pub use const_format::concatcp;
#[macro_export]
macro_rules! id {
($ns:expr, $path:expr) => {
$crate::concatcp!($ns, $crate::sep::NAMESPACE, $path)
};
}
macro_rules! names {
($( $(#[$gdoc:meta])* $group:ident { $( $(#[$doc:meta])* $name:ident = $value:expr ),* $(,)? } )*) => {
$(
$(#[$gdoc])*
pub mod $group {
$( $(#[$doc])* pub const $name: &str = $value; )*
pub const ALL_VALUES: &[&str] = &[$($name),*];
}
)*
pub const ALL: &[$crate::Group] = &[ $( (stringify!($group), &[ $( (stringify!($name), $group::$name) ),* ]) ),* ];
};
}
mod names {
pub mod base;
pub mod bus;
pub mod content;
pub mod datapack;
pub mod services;
pub mod ui;
}
pub mod env;
pub mod export;
mod formats;
pub mod platform;
#[cfg(test)]
mod tests;
pub mod time;
pub mod units;
pub mod versions;
pub use formats::*;
pub use names::base::*;
pub use names::bus::*;
pub use names::content::*;
pub use names::datapack::*;
pub use names::services::*;
pub use names::ui::*;
pub type Group = (&'static str, &'static [(&'static str, &'static str)]);
pub const ALL: &[&[Group]] = &[
names::base::ALL,
names::bus::ALL,
names::services::ALL,
names::content::ALL,
names::datapack::ALL,
names::ui::ALL,
];
pub fn groups() -> impl Iterator<Item = &'static Group> {
ALL.iter().flat_map(|file| file.iter())
}