librustc: Remove @ pointer patterns from the language

This commit is contained in:
Patrick Walton
2014-01-03 15:08:48 -08:00
parent ce358fca33
commit 119c6141f5
53 changed files with 1006 additions and 1027 deletions

View File

@@ -614,7 +614,7 @@ pub fn walk_pat(pat: &Pat, it: |&Pat| -> bool) -> bool {
PatEnum(_, Some(ref s)) | PatTup(ref s) => {
s.iter().advance(|&p| walk_pat(p, |p| it(p)))
}
PatBox(s) | PatUniq(s) | PatRegion(s) => {
PatUniq(s) | PatRegion(s) => {
walk_pat(s, it)
}
PatVec(ref before, ref slice, ref after) => {
@@ -945,6 +945,15 @@ pub fn segments_name_eq(a : &[ast::PathSegment], b : &[ast::PathSegment]) -> boo
}
}
// Returns true if this literal is a string and false otherwise.
pub fn lit_is_str(lit: @Lit) -> bool {
match lit.node {
LitStr(..) => true,
_ => false,
}
}
#[cfg(test)]
mod test {
use ast::*;