Skip to content

Commit 0fa24f3

Browse files
EijebongSimonSapin
authored andcommitted
Update syn and bump version
1 parent 6d92708 commit 0fa24f3

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cssparser"
3-
version = "0.25.0"
3+
version = "0.25.1"
44
authors = [ "Simon Sapin <[email protected]>" ]
55

66
description = "Rust implementation of CSS Syntax Level 3"
@@ -30,7 +30,7 @@ serde = {version = "1.0", optional = true}
3030
smallvec = "0.6"
3131

3232
[build-dependencies]
33-
syn = { version = "0.14", features = ["extra-traits", "fold", "full"] }
33+
syn = { version = "0.15.12", features = ["extra-traits", "fold", "full"] }
3434
quote = "0.6"
3535
proc-macro2 = "0.4"
3636

build/match_byte.rs

+16-9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::io::{Read, Write};
88
use std::path::Path;
99
use syn;
1010
use syn::fold::Fold;
11+
use syn::parse::{Parse, ParseStream, Result};
1112

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

@@ -30,17 +31,23 @@ struct MatchByte {
3031
arms: Vec<syn::Arm>,
3132
}
3233

33-
impl syn::synom::Synom for MatchByte {
34-
named!(parse -> Self, do_parse!(
35-
expr: syn!(syn::Expr) >>
36-
punct!(,) >>
37-
arms: many0!(syn!(syn::Arm)) >> (
38-
MatchByte {
39-
expr,
34+
impl Parse for MatchByte {
35+
fn parse(input: ParseStream) -> Result<Self> {
36+
Ok(MatchByte {
37+
expr: {
38+
let expr = input.parse()?;
39+
input.parse::<Token![,]>()?;
40+
expr
41+
},
42+
arms: {
43+
let mut arms = Vec::new();
44+
while !input.is_empty() {
45+
arms.push(input.call(syn::Arm::parse)?);
46+
}
4047
arms
4148
}
42-
)
43-
));
49+
})
50+
}
4451
}
4552

4653
fn get_byte_from_expr_lit(expr: &Box<syn::Expr>) -> u8 {

macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ proc-macro = true
1515
procedural-masquerade = {path = "../procedural-masquerade", version = "0.1"}
1616
phf_codegen = "0.7"
1717
quote = "0.6"
18-
syn = {version = "0.14", features = ["full", "extra-traits"]}
18+
syn = {version = "0.15.12", features = ["full", "extra-traits"]}
1919
proc-macro2 = "0.4"

0 commit comments

Comments
 (0)