mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 04:03:11 +00:00
allow underscore
This commit is contained in:
parent
53ecabad04
commit
bf3bf8c235
@ -460,7 +460,7 @@ fn replace_names(input: &str) -> Option<(String, HashMap<String, String>)> {
|
||||
} else if c == '(' && cur_name.is_empty() {
|
||||
// FIXME: Support macro def with repeat.
|
||||
return None;
|
||||
} else if c.is_alphanumeric() {
|
||||
} else if c.is_alphanumeric() || c == '_' {
|
||||
cur_name.push(c);
|
||||
}
|
||||
}
|
||||
|
@ -168,3 +168,23 @@ macro_rules! add_message_to_notes {
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
// #2560
|
||||
macro_rules! binary {
|
||||
($_self:ident,$expr:expr, $lhs:expr,$func:ident) => {
|
||||
while $_self.matched($expr) {
|
||||
let op = $_self.get_binary_op()?;
|
||||
|
||||
let rhs = Box::new($_self.$func()?);
|
||||
|
||||
$lhs = Spanned {
|
||||
span: $lhs.get_span().to(rhs.get_span()),
|
||||
value: Expression::Binary {
|
||||
lhs: Box::new($lhs),
|
||||
op,
|
||||
rhs,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -200,3 +200,23 @@ macro_rules! add_message_to_notes {
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
// #2560
|
||||
macro_rules! binary {
|
||||
($_self:ident, $expr:expr, $lhs:expr, $func:ident) => {
|
||||
while $_self.matched($expr) {
|
||||
let op = $_self.get_binary_op()?;
|
||||
|
||||
let rhs = Box::new($_self.$func()?);
|
||||
|
||||
$lhs = Spanned {
|
||||
span: $lhs.get_span().to(rhs.get_span()),
|
||||
value: Expression::Binary {
|
||||
lhs: Box::new($lhs),
|
||||
op,
|
||||
rhs,
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user