Skip to content

Update syn, quote, proc-macro2 and bump versions #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cssparser"
version = "0.23.9"
version = "0.23.10"
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]

description = "Rust implementation of CSS Syntax Level 3"
Expand Down Expand Up @@ -30,9 +30,9 @@ serde = {version = "1.0", optional = true}
smallvec = "0.6"

[build-dependencies]
syn = { version = "0.13", features = ["extra-traits", "fold"] }
quote = "0.5"
proc-macro2 = "0.3"
syn = { version = "0.14", features = ["extra-traits", "fold"] }
quote = "0.6"
proc-macro2 = "0.4"

[features]
bench = []
Expand Down
8 changes: 4 additions & 4 deletions build/match_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::path::Path;
use syn;
use syn::fold::Fold;

use proc_macro2::TokenStream;
use proc_macro2::{Span, TokenStream};

struct MatchByteParser {
}
Expand All @@ -21,7 +21,7 @@ pub fn expand(from: &Path, to: &Path) {
let mut m = MatchByteParser {};
let ast = m.fold_file(ast);

let code = ast.into_tokens().to_string().replace("{ ", "{\n").replace(" }", "\n}");
let code = ast.into_token_stream().to_string().replace("{ ", "{\n").replace(" }", "\n}");
File::create(to).unwrap().write_all(code.as_bytes()).unwrap();
}

Expand Down Expand Up @@ -82,7 +82,7 @@ fn expand_match_byte(body: &TokenStream) -> syn::Expr {
for (i, ref arm) in match_byte.arms.iter().enumerate() {
let case_id = i + 1;
let index = case_id as isize;
let name = syn::Ident::from(format!("Case{}", case_id));
let name = syn::Ident::new(&format!("Case{}", case_id), Span::call_site());

for pat in &arm.pats {
match pat {
Expand Down Expand Up @@ -111,7 +111,7 @@ fn expand_match_byte(body: &TokenStream) -> syn::Expr {
}
}
},
&syn::Pat::Ident(syn::PatIdent { ident, .. }) => {
&syn::Pat::Ident(syn::PatIdent { ref ident, .. }) => {
assert_eq!(wildcard, None);
wildcard = Some(ident);
for byte in table.iter_mut() {
Expand Down
8 changes: 4 additions & 4 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cssparser-macros"
version = "0.3.3"
version = "0.3.4"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Procedural macros for cssparser"
documentation = "https://docs.rs/cssparser-macros/"
Expand All @@ -14,6 +14,6 @@ proc-macro = true
[dependencies]
procedural-masquerade = {path = "../procedural-masquerade", version = "0.1"}
phf_codegen = "0.7"
quote = "0.5"
syn = {version = "0.13", features = ["full", "extra-traits"]}
proc-macro2 = "0.3"
quote = "0.6"
syn = {version = "0.14", features = ["full", "extra-traits"]}
proc-macro2 = "0.4"
1 change: 1 addition & 0 deletions macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern crate proc_macro2;
extern crate syn;

#[allow(unused_imports)] use std::ascii::AsciiExt;
use quote::TokenStreamExt;
use std::iter;
use proc_macro2::{TokenStream, TokenTree};

Expand Down