about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorDavid Rajchenbach-Teller <dteller@mozilla.com>2011-11-07 14:46:02 +0100
committerBrian Anderson <banderson@mozilla.com>2011-11-07 12:04:16 -0800
commit16bdb85cb408ca9f324a1ca83596b1b3dbec67b1 (patch)
treec7f7082c7324e1d95e97f637b8b55387858686fa /src/comp/syntax/parse
parent852e789e789b424f70614869d89f2611dae2002d (diff)
downloadrust-16bdb85cb408ca9f324a1ca83596b1b3dbec67b1.tar.gz
rust-16bdb85cb408ca9f324a1ca83596b1b3dbec67b1.zip
[Parser] parser.rs: Made two error messages less ambiguous
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 66a3b3440e8..f859300f3ea 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1268,7 +1268,9 @@ fn parse_if_expr_1(p: parser) ->
         hi = elexpr.span.hi;
     } else if !option::is_none(thn.node.expr) {
         let sp = option::get(thn.node.expr).span;
-        p.span_fatal(sp, "if without else can not return a value");
+        p.span_fatal(sp, "`if` without `else` can not produce a result");
+        //TODO: If a suggestion mechanism appears, suggest that the
+        //user may have forgotten a ';'
     }
     ret {cond: cond, then: thn, els: els, lo: lo, hi: hi};
 }
@@ -1679,7 +1681,9 @@ fn parse_block_no_value(p: parser) -> ast::blk {
     let blk = parse_block(p);
     if !option::is_none(blk.node.expr) {
         let sp = option::get(blk.node.expr).span;
-        p.span_fatal(sp, "this block must not return a value");
+        p.span_fatal(sp, "this block must not have a result");
+        //TODO: If a suggestion mechanism appears, suggest that the
+        //user may have forgotten a ';'
     }
     ret blk;
 }