Upgrade to new versions of proc-macro2

Gonna get some nice spans back!
This commit is contained in:
Alex Crichton
2018-05-21 07:29:34 -07:00
parent 627ca1d638
commit e76f5537e0
5 changed files with 212 additions and 190 deletions

View File

@ -17,9 +17,7 @@ proc-macro = true
spans = ["wasm-bindgen-backend/spans"]
[dependencies]
syn = { version = '0.13', features = ['full'] }
quote = '0.5'
proc-macro2 = "0.3"
serde_json = "1"
wasm-bindgen-shared = { path = "../shared", version = "=0.2.10" }
syn = { version = '0.14', features = ['full'] }
quote = '0.6'
proc-macro2 = "0.4"
wasm-bindgen-backend = { path = "../backend", version = "=0.2.10" }

View File

@ -4,12 +4,10 @@ extern crate syn;
extern crate quote;
extern crate proc_macro;
extern crate proc_macro2;
extern crate serde_json;
extern crate wasm_bindgen_backend as backend;
extern crate wasm_bindgen_shared as shared;
use proc_macro::TokenStream;
use quote::{ToTokens, Tokens};
use quote::ToTokens;
#[proc_macro_attribute]
pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
@ -17,7 +15,7 @@ pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
let opts = syn::parse::<backend::ast::BindgenAttrs>(attr)
.expect("invalid arguments to #[wasm_bindgen]");
let mut ret = Tokens::new();
let mut ret = proc_macro2::TokenStream::empty();
let mut program = backend::ast::Program::default();
program.push_item(item, Some(opts), &mut ret);
program.to_tokens(&mut ret);