Skip to content

Commit 9907849

Browse files
committed
Update syn and bump version
1 parent 394b781 commit 9907849

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cssparser"
3-
version = "0.24.1"
3+
version = "0.24.2"
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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use std::io::{Read, Write};
88
use std::path::Path;
99
use syn;
1010
use syn::fold::Fold;
11+
use syn::punctuated::Punctuated;
12+
use syn::parse::{Parse, ParseStream, Result};
1113

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

@@ -27,20 +29,18 @@ pub fn expand(from: &Path, to: &Path) {
2729

2830
struct MatchByte {
2931
expr: syn::Expr,
30-
arms: Vec<syn::Arm>,
32+
_comma: Token![,],
33+
arms: Punctuated<syn::Arm, Option<Token![,]>>,
3134
}
3235

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,
40-
arms
41-
}
42-
)
43-
));
36+
impl Parse for MatchByte {
37+
fn parse(input: ParseStream) -> Result<Self> {
38+
Ok(MatchByte {
39+
expr: input.parse()?,
40+
_comma: input.parse()?,
41+
arms: Punctuated::parse_terminated(input)?,
42+
})
43+
}
4444
}
4545

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

macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
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)