diff --git a/crates/relax-macros/src/lib.rs b/crates/relax-macros/src/lib.rs index bc22927..7ffd119 100644 --- a/crates/relax-macros/src/lib.rs +++ b/crates/relax-macros/src/lib.rs @@ -78,6 +78,7 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result { // * ident + punct // * ident + group + punct // * ident (the last one) + // * ident + group (the last one) let ident: syn::Ident = syn::parse2(token.into_token_stream())?; @@ -104,6 +105,12 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result { }; extra_attrs.push(quote! { #[#ident #group] }); + + // if the second item was group, we may need to consume the next punct + // but we may have ran out of tokens at this point + if relax_attr_tokens.next().is_none() { + break; + } } let fields = match &input.data {