summaryrefslogtreecommitdiff
path: root/src/func/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/func/macros.rs')
-rw-r--r--src/func/macros.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/func/macros.rs b/src/func/macros.rs
index 17a554cf..df795213 100644
--- a/src/func/macros.rs
+++ b/src/func/macros.rs
@@ -5,22 +5,25 @@
macro_rules! function {
// Parse a unit struct.
($(#[$outer:meta])* pub struct $type:ident; $($rest:tt)*) => {
- $(#[$outer])*
- pub struct $type;
+ $(#[$outer])* pub struct $type;
function!(@meta $type | $($rest)*);
};
// Parse a tuple struct.
($(#[$outer:meta])* pub struct $type:ident($($fields:tt)*); $($rest:tt)*) => {
- $(#[$outer])*
- pub struct $type($($fields)*);
+ $(#[$outer])* pub struct $type($($fields)*);
function!(@meta $type | $($rest)*);
};
// Parse a struct with fields.
($(#[$outer:meta])* pub struct $type:ident { $($fields:tt)* } $($rest:tt)*) => {
- $(#[$outer])*
- pub struct $type { $($fields)* }
+ $(#[$outer])* pub struct $type { $($fields)* }
+ function!(@meta $type | $($rest)*);
+ };
+
+ // Parse an enum.
+ ($(#[$outer:meta])* pub enum $type:ident { $($fields:tt)* } $($rest:tt)*) => {
+ $(#[$outer])* pub enum $type { $($fields)* }
function!(@meta $type | $($rest)*);
};