syntax: Make match arm parsing more restrictive again
Require comma separators for all expression types except the plain block
This commit is contained in:
parent
abf4421e7c
commit
2772b2e5c7
36 changed files with 107 additions and 156 deletions
|
@ -649,7 +649,7 @@ fn print_item(s: ps, &&item: @ast::item) {
|
|||
/// expression arguments as expressions). It can be done! I think.
|
||||
fn print_tt(s: ps, tt: ast::token_tree) {
|
||||
match tt {
|
||||
ast::tt_delim(tts) => for tts.each() |tt_elt| { print_tt(s, tt_elt); }
|
||||
ast::tt_delim(tts) => for tts.each() |tt_elt| { print_tt(s, tt_elt); },
|
||||
ast::tt_tok(_, tk) => {
|
||||
match tk {
|
||||
parse::token::IDENT(*) => { // don't let idents run together
|
||||
|
@ -953,7 +953,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
|
|||
print_vstore(s, v);
|
||||
print_expr(s, e);
|
||||
}
|
||||
}
|
||||
},
|
||||
ast::expr_vec(exprs, mutbl) => {
|
||||
ibox(s, indent_unit);
|
||||
word(s.s, ~"[");
|
||||
|
@ -1114,7 +1114,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
|
|||
some(expr) => {
|
||||
end(s); // close the ibox for the pattern
|
||||
print_expr(s, expr);
|
||||
if expr_requires_semi_to_be_stmt(expr)
|
||||
if !expr_is_simple_block(expr)
|
||||
&& i < len - 1 {
|
||||
word(s.s, ~",");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue