Allow use of [_ ; n] syntax for fixed length and repeating arrays.

This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
This commit is contained in:
Nick Cameron
2014-12-20 15:20:51 +13:00
parent cbe9fb45bc
commit 2e86929a4a
122 changed files with 260 additions and 266 deletions

View File

@@ -755,7 +755,7 @@ impl<'a> State<'a> {
ast::TyFixedLengthVec(ref ty, ref v) => {
try!(word(&mut self.s, "["));
try!(self.print_type(&**ty));
try!(word(&mut self.s, ", .."));
try!(word(&mut self.s, "; "));
try!(self.print_expr(&**v));
try!(word(&mut self.s, "]"));
}
@@ -1531,8 +1531,7 @@ impl<'a> State<'a> {
try!(self.ibox(indent_unit));
try!(word(&mut self.s, "["));
try!(self.print_expr(&**element));
try!(word(&mut self.s, ","));
try!(word(&mut self.s, ".."));
try!(self.word_space(";"));
try!(self.print_expr(&**count));
try!(word(&mut self.s, "]"));
try!(self.end());