match_token-0.35.0/.cargo_vcs_info.json 0000644 00000000151 00000000001 0013412 0 ustar {
"git": {
"sha1": "6db7bbf1c4dfaecd28731950d427e40c8b911bef"
},
"path_in_vcs": "match_token"
} match_token-0.35.0/Cargo.toml 0000644 00000002112 00000000001 0011407 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.70.0"
name = "match_token"
version = "0.35.0"
authors = ["The html5ever Project Developers"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Procedural macro for html5ever."
documentation = "https://docs.rs/match_token"
readme = false
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
[lib]
name = "match_token"
path = "src/lib.rs"
proc-macro = true
[dependencies.proc-macro2]
version = "1"
[dependencies.quote]
version = "1"
[dependencies.syn]
version = "2"
features = ["full"]
match_token-0.35.0/Cargo.toml.orig 0000644 0000000 0000000 00000000637 10461020230 0015102 0 ustar 0000000 0000000 [package]
name = "match_token"
description = "Procedural macro for html5ever."
documentation = "https://docs.rs/match_token"
version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
syn = { workspace = true }
quote = { workspace = true }
proc-macro2 = { workspace = true }
[lib]
proc-macro = true
match_token-0.35.0/src/lib.rs 0000644 0000000 0000000 00000031412 10461020230 0014111 0 ustar 0000000 0000000 extern crate proc_macro;
use quote::quote;
use syn::{braced, Token};
use std::collections::HashSet;
use syn::ext::IdentExt;
use syn::parse::{Parse, ParseStream, Result};
/// Implements the `match_token!()` macro for use by the HTML tree builder
/// in `src/tree_builder/rules.rs`.
///
/// ## Example
///
/// ```rust,ignore
/// match_token!(token {
/// CommentToken(text) => 1,
/// tag @ => 2,
/// => 3,
///