From 48a8271b994d1d6a9999bba3e1dbfef197d42678 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 3 Sep 2024 10:10:30 -0700 Subject: [PATCH] transpose macro_repeated --- fixed_wide_vectors/src/macros/fixed_wide.rs | 10 ++++++++-- fixed_wide_vectors/src/macros/matrix.rs | 4 ++-- fixed_wide_vectors/src/macros/mod.rs | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fixed_wide_vectors/src/macros/fixed_wide.rs b/fixed_wide_vectors/src/macros/fixed_wide.rs index 3cb65ce..f0f5ca7 100644 --- a/fixed_wide_vectors/src/macros/fixed_wide.rs +++ b/fixed_wide_vectors/src/macros/fixed_wide.rs @@ -1,7 +1,10 @@ #[doc(hidden)] #[macro_export(local_inner_macros)] macro_rules! impl_wide_vector_operations_2arg_not_const_generic { - ( ($lhs:expr, $rhs:expr), ($struct: ident { $($field: ident), + }, $size: expr) ) => { + ( + ($struct: ident { $($field: ident), + }, $size: expr), + ($lhs:expr, $rhs:expr) + ) => { impl $struct>{ paste::item!{ #[inline] @@ -23,7 +26,10 @@ macro_rules! impl_wide_vector_operations_2arg_not_const_generic { #[doc(hidden)] #[macro_export(local_inner_macros)] macro_rules! impl_wide_vector_operations_1arg_not_const_generic { - ( $n:expr, ($struct: ident { $($field: ident), + }, $size: expr) ) => { + ( + ($struct: ident { $($field: ident), + }, $size: expr), + $n:expr + ) => { impl $struct>{ paste::item!{ #[inline] diff --git a/fixed_wide_vectors/src/macros/matrix.rs b/fixed_wide_vectors/src/macros/matrix.rs index 8e009cb..1e27a07 100644 --- a/fixed_wide_vectors/src/macros/matrix.rs +++ b/fixed_wide_vectors/src/macros/matrix.rs @@ -22,8 +22,8 @@ macro_rules! impl_matrix { #[macro_export(local_inner_macros)] macro_rules! impl_matrix_shim { ( - $matrix_info:tt, - () + (), + $matrix_info:tt ) => { $crate::impl_matrix!($matrix_info); } diff --git a/fixed_wide_vectors/src/macros/mod.rs b/fixed_wide_vectors/src/macros/mod.rs index adf672a..572d35c 100644 --- a/fixed_wide_vectors/src/macros/mod.rs +++ b/fixed_wide_vectors/src/macros/mod.rs @@ -14,7 +14,7 @@ macro_rules! macro_repeated{ $($repeated:tt),* )=>{ $( - $crate::$macro!($repeated, $any); + $crate::$macro!($any, $repeated); )* }; }