Tweak error messages a bit

This commit is contained in:
Chris Wong 2015-03-14 21:13:40 +13:00
parent a118f54612
commit 4da1e369cd

View file

@ -159,7 +159,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
self.shift(1); self.shift(1);
cond_tts.push(tt.clone()); cond_tts.push(tt.clone());
}, },
[] => self.render.cx.span_fatal(sp, "expected body for this `if`"), [] => self.render.cx.span_fatal(sp, "expected body for this $if"),
}} }}
let if_cond = self.new_rust_parser(cond_tts).parse_expr(); let if_cond = self.new_rust_parser(cond_tts).parse_expr();
// Parse the (optional) else // Parse the (optional) else
@ -184,7 +184,7 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
self.shift(1); self.shift(1);
Some(self.block(sp, &d.tts)) Some(self.block(sp, &d.tts))
}, },
_ => self.render.cx.span_fatal(sp, "invalid syntax"), _ => self.render.cx.span_fatal(sp, "expected body for this $else"),
} }
}, },
_ => None, _ => None,