Re: [PATCH v2 2/5] rust: macros: support additional tokens in quote!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Alice Ryhl" <aliceryhl@xxxxxxxxxx> writes:

> This gives the quote! macro support for the following additional tokens:
>
> * The = token.
> * The _ token.
> * Using #my_var with variables of type Ident.
>
> Additionally, some type annotations are added to allow cases where
> groups are empty. For example, quote! does support () in the input, but
> only when it is *not* empty. When it is empty, the compiler cannot infer
> the item type of `tokens`.
>
> These additional quote! features are used by a new proc macro that
> generates code looking like this:
>
> 	const _: () = {
> 	    if true {
> 	        ::kernel::bindings::#name
> 	    } else {
> 	        #name
> 	    };
> 	};
>
> where #name has type Ident.
>
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>


Best regards,
Andreas Hindborg





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux