Browse Source

Support trailing commas

Getty Ritter 2 years ago
parent
commit
d2e1a7a720
1 changed files with 16 additions and 16 deletions
  1. 16 16
      src/lib.rs

+ 16 - 16
src/lib.rs

@@ -43,19 +43,19 @@ macro_rules! system_impl {
 
 #[macro_export]
 macro_rules! args_to_systemdata {
-    ( ( $name:ident : Entity $(,)? ) ) => {
+    ( ( $name:ident : Entity $(,)* ) ) => {
         ( specs::Entities<'a>, )
     };
-    ( ( $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( $name:ident : $ty:ty $(,)* ) ) => {
         ( specs::ReadStorage<'a, $ty> ,)
     };
-    ( ( mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( mut $name:ident : $ty:ty $(,)* ) ) => {
         ( specs::WriteStorage<'a, $ty> ,)
     };
-    ( ( resource $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
-    ( ( resource mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource mut $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
     ( ( $name:ident : Entity , $($tok:tt)* ) ) => {
@@ -77,16 +77,16 @@ macro_rules! args_to_systemdata {
 
 #[macro_export]
 macro_rules! args_to_fn_pat {
-    ( ( $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( $name:ident : $ty:ty $(,)* ) ) => {
         ( $name ,)
     };
-    ( ( mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( mut $name:ident : $ty:ty $(,)* ) ) => {
         ( mut $name ,)
     };
-    ( ( resource $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
-    ( ( resource mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource mut $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
     ( ( $name:ident : $ty:ty , $($tok:tt)* ) ) => {
@@ -105,16 +105,16 @@ macro_rules! args_to_fn_pat {
 
 #[macro_export]
 macro_rules! args_to_join_pat {
-    ( ( $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( $name:ident : $ty:ty $(,)* ) ) => {
         ( $name ,)
     };
-    ( ( mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( mut $name:ident : $ty:ty $(,)* ) ) => {
         ( mut $name ,)
     };
-    ( ( resource $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
-    ( ( resource mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource mut $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
     ( ( $name:ident : $ty:ty , $($tok:tt)* ) ) => {
@@ -133,16 +133,16 @@ macro_rules! args_to_join_pat {
 
 #[macro_export]
 macro_rules! args_to_join {
-    ( ( $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( $name:ident : $ty:ty $(,)* ) ) => {
         ( & $name ,)
     };
-    ( ( mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( mut $name:ident : $ty:ty $(,)* ) ) => {
         ( &mut $name ,)
     };
     ( ( resource $name:ident : $ty:ty $(,)? ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
-    ( ( resource mut $name:ident : $ty:ty $(,)? ) ) => {
+    ( ( resource mut $name:ident : $ty:ty $(,)* ) ) => {
         compile_error!("Resources cannot come at the end of the argument block.")
     };
     ( ( $name:ident : $ty:ty , $($tok:tt)* ) ) => {