Fix error blocks

This commit is contained in:
Aleksey Kladov 2018-08-27 21:10:02 +03:00
parent 7f4b07a907
commit b79c8b6d8a
6 changed files with 20 additions and 1 deletions

View file

@ -269,6 +269,10 @@ fn match_arm_list(p: &mut Parser) {
let m = p.start();
p.eat(L_CURLY);
while !p.at(EOF) && !p.at(R_CURLY) {
if p.at(L_CURLY) {
error_block(p, "expected match arm");
continue;
}
// test match_arms_commas
// fn foo() {
// match () {

View file

@ -433,6 +433,7 @@ fn named_field_list(p: &mut Parser) {
p.bump();
expr(p);
}
L_CURLY => error_block(p, "expected a field"),
_ => p.err_and_bump("expected identifier"),
}
if !p.at(R_CURLY) {