Skip to content

Commit 1aaf985

Browse files
author
bors-servo
authored
Auto merge of #223 - servo:hackless, r=nox
Remove unnecessary hack <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/223) <!-- Reviewable:end -->
2 parents aae57f6 + 381edab commit 1aaf985

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

macros/match_token.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -441,25 +441,22 @@ fn expand_match_token_macro(to_be_matched: syn::Ident, mut arms: Vec<Arm>) -> To
441441
};
442442

443443
quote! {
444-
// Use a no-op macro to work around a bug(?) in syn::parse_exr.
445-
as_expr! {
446-
match #to_be_matched {
447-
#(
448-
#arms_code
449-
)*
450-
last_arm_token => {
451-
let enable_wildcards = match last_arm_token {
452-
#(
453-
#wild_excluded_patterns => false,
454-
)*
455-
_ => true,
456-
};
457-
match (enable_wildcards, last_arm_token) {
458-
#(
459-
(true, #wildcards_patterns) => #wildcards_expressions
460-
)*
461-
(_, #last_pat) => #last_expr
462-
}
444+
match #to_be_matched {
445+
#(
446+
#arms_code
447+
)*
448+
last_arm_token => {
449+
let enable_wildcards = match last_arm_token {
450+
#(
451+
#wild_excluded_patterns => false,
452+
)*
453+
_ => true,
454+
};
455+
match (enable_wildcards, last_arm_token) {
456+
#(
457+
(true, #wildcards_patterns) => #wildcards_expressions
458+
)*
459+
(_, #last_pat) => #last_expr
463460
}
464461
}
465462
}

src/tree_builder/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ mod data;
4040
mod types;
4141
mod actions;
4242

43-
/// This macro is used in macros/match_token.rs to work around a bug(?) in syn::parse_exr.
44-
macro_rules! as_expr {
45-
($e: expr) => ($e)
46-
}
47-
4843
mod rules {
4944
//! The tree builder rules, as a single, enormous nested match expression.
5045

0 commit comments

Comments
 (0)