1#[macro_export]
2macro_rules! node_ids {
3 (pub $name: ident: $first_kind: ident, $($kind: ident),*) => {
4 pub struct $name;
5 #[allow(non_upper_case_globals)]
6 impl $name {
7 pub const $first_kind: NodeId = NodeId(stringify!($first_kind));
8 $( pub const $kind: NodeId = NodeId(stringify!($kind)); )*
9 }
10 };
11 ($name: ident: $first_kind: ident, $($kind: ident),*) => {
12 struct $name;
13 #[allow(non_upper_case_globals)]
14 impl $name {
15 const $first_kind: NodeId = NodeId(stringify!($first_kind));
16 $( const $kind: NodeId = NodeId(stringify!($kind)); )*
17 }
18 };
19}