提交 880b1ec9 编写于 作者: B Brian Anderson

Fail nicer when the parser doesn't find an expected string literal

Closes #1028
上级 15d33f79
......@@ -2489,8 +2489,10 @@ fn parse_crate_mod(p: parser, _cfg: ast::crate_cfg) -> @ast::crate {
fn parse_str(p: parser) -> str {
alt p.peek() {
token::LIT_STR(s) { p.bump(); ret p.get_str(s); }
_ { fail; }
token::LIT_STR(s) { p.bump(); p.get_str(s) }
_ {
p.fatal("expected string literal")
}
}
}
......
// error-pattern: expected string literal
// Issue #1028
mod ncurses = x;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册