Support parentheses in patterns under feature gate

Improve recovery for trailing comma after `..`
This commit is contained in:
Vadim Petrochenkov
2018-02-24 15:27:06 +03:00
parent 0ff9872b22
commit c9aff92e6d
12 changed files with 166 additions and 107 deletions

View File

@@ -2659,6 +2659,11 @@ impl<'a> State<'a> {
|s, p| s.print_pat(p))?;
self.s.word("]")?;
}
PatKind::Paren(ref inner) => {
self.popen()?;
self.print_pat(inner)?;
self.pclose()?;
}
PatKind::Mac(ref m) => self.print_mac(m, token::Paren)?,
}
self.ann.post(self, NodePat(pat))