call2-for-syn

Latest Version docs.rs

This library provides a call2 function that sits somewhere in-between syn's parse2 and ParseBuffer::call: It lets you conveniently apply a parser function to a proc-macro2 token stream, for example from a quote!.

Example

```rust use { call2forsyn::call2, quote::quote, syn::{Ident, Token}, };

let (hello, world) = call2::, >(quote!(Hello world!), |input| { let hello: Ident = input.parse()?; let world: Ident = input.parse()?; input.parse::eq!(format!("{}", hello), "Hello"); assert_eq!(format!("{}", world), "world"); ```