From b6971d94dfa67f4e0ce81c2cd70af6f8b1dad8fa Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 31 May 2011 10:58:30 -0700 Subject: Consolidate formatting functions a bit more. --- src/comp/front/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/comp/front') 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); } } -- cgit 1.4.1-3-g733a5