diff options
| author | John Gallagher <jgallagher@bignerdranch.com> | 2014-10-02 22:45:46 -0400 |
|---|---|---|
| committer | John Gallagher <jgallagher@bignerdranch.com> | 2014-10-10 20:30:31 -0400 |
| commit | 0c2c8116a307e88f8327e0ea846d2c9c135193b7 (patch) | |
| tree | b9f17f6dc86f3e98b77b0eaf18a7d5ecb05bd7a4 /src/libsyntax/print/pprust.rs | |
| parent | 78a7676898d9f80ab540c6df5d4c9ce35bb50463 (diff) | |
| download | rust-0c2c8116a307e88f8327e0ea846d2c9c135193b7.tar.gz rust-0c2c8116a307e88f8327e0ea846d2c9c135193b7.zip | |
Teach libsyntax about `while let`
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index e1a2b2aeefe..fd3dd1c5a2c 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1525,6 +1525,19 @@ impl<'a> State<'a> { try!(space(&mut self.s)); try!(self.print_block(&**blk)); } + ast::ExprWhileLet(ref pat, ref expr, ref blk, opt_ident) => { + for ident in opt_ident.iter() { + try!(self.print_ident(*ident)); + try!(self.word_space(":")); + } + try!(self.head("while let")); + try!(self.print_pat(&**pat)); + try!(space(&mut self.s)); + try!(self.word_space("=")); + try!(self.print_expr(&**expr)); + try!(space(&mut self.s)); + try!(self.print_block(&**blk)); + } ast::ExprForLoop(ref pat, ref iter, ref blk, opt_ident) => { for ident in opt_ident.iter() { try!(self.print_ident(*ident)); |
