2022-08-07 17:05:20 -05:00
|
|
|
macro_rules! values {
|
|
|
|
($($token:ident($value:literal) $(as $inner:ty)? => $attr:meta,)*) => {
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum TokenKind {
|
|
|
|
$(
|
|
|
|
#[$attr]
|
|
|
|
$token $($inner)? = $value,
|
|
|
|
)*
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2023-07-31 09:55:47 -05:00
|
|
|
//~^^^^^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found type `(String)`
|
2022-08-07 17:05:20 -05:00
|
|
|
//~| ERROR macro expansion ignores token `(String)` and any following
|
|
|
|
|
|
|
|
values!(STRING(1) as (String) => cfg(test),);
|
2022-08-08 12:17:37 -05:00
|
|
|
//~^ ERROR expected one of `!` or `::`, found `<eof>`
|
2022-08-07 17:05:20 -05:00
|
|
|
|
|
|
|
fn main() {}
|