Skip to content
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cssparser"
version = "0.25.0"
version = "0.25.1"
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]

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

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

Expand Down
25 changes: 16 additions & 9 deletions build/match_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::io::{Read, Write};
use std::path::Path;
use syn;
use syn::fold::Fold;
use syn::parse::{Parse, ParseStream, Result};

use proc_macro2::{Span, TokenStream};

Expand All @@ -30,17 +31,23 @@ struct MatchByte {
arms: Vec<syn::Arm>,
}

impl syn::synom::Synom for MatchByte {
named!(parse -> Self, do_parse!(
expr: syn!(syn::Expr) >>
punct!(,) >>
arms: many0!(syn!(syn::Arm)) >> (
MatchByte {
expr,
impl Parse for MatchByte {
fn parse(input: ParseStream) -> Result<Self> {
Ok(MatchByte {
expr: {
let expr = input.parse()?;
input.parse::<Token![,]>()?;
expr
},
arms: {
let mut arms = Vec::new();
while !input.is_empty() {
arms.push(input.call(syn::Arm::parse)?);
}
arms
}
)
));
})
}
}

fn get_byte_from_expr_lit(expr: &Box<syn::Expr>) -> u8 {
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ proc-macro = true
procedural-masquerade = {path = "../procedural-masquerade", version = "0.1"}
phf_codegen = "0.7"
quote = "0.6"
syn = {version = "0.14", features = ["full", "extra-traits"]}
syn = {version = "0.15.12", features = ["full", "extra-traits"]}
proc-macro2 = "0.4"