diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-05-31 10:58:30 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-05-31 11:00:47 -0700 |
| commit | b6971d94dfa67f4e0ce81c2cd70af6f8b1dad8fa (patch) | |
| tree | d7828372428a6dd64f22d147cbafee4cd253fe50 /src/comp/front | |
| parent | 55e3cd41de71a35512bee745b4ababd8c007ac07 (diff) | |
| download | rust-b6971d94dfa67f4e0ce81c2cd70af6f8b1dad8fa.tar.gz rust-b6971d94dfa67f4e0ce81c2cd70af6f8b1dad8fa.zip | |
Consolidate formatting functions a bit more.
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index a6d8560ee67..a8da7294928 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1597,7 +1597,7 @@ fn stmt_to_expr(@ast::stmt stmt) -> option::t[@ast::expr] { ret none[@ast::expr]; } -fn stmt_ends_with_semi(@ast::stmt stmt) -> bool { +fn stmt_ends_with_semi(&ast::stmt stmt) -> bool { alt (stmt.node) { case (ast::stmt_decl(?d,_)) { alt (d.node) { @@ -1675,7 +1675,7 @@ fn parse_block(&parser p) -> ast::block { } case (token::RBRACE) { expr = some(e); } case (?t) { - if (stmt_ends_with_semi(stmt)) { + if (stmt_ends_with_semi(*stmt)) { p.err("expected ';' or '}' after " + "expression but found " + token::to_str(p.get_reader(), t)); @@ -1692,7 +1692,7 @@ fn parse_block(&parser p) -> ast::block { // used in branches and binary expressions in rustboot // means we cannot use && here. I know, right? if (p.get_file_type() == SOURCE_FILE) { - if (stmt_ends_with_semi(stmt)) { + if (stmt_ends_with_semi(*stmt)) { expect(p, token::SEMI); } } |
