Skip to content

Commit dd9b6dc

Browse files
committed
Remove some truly wrong logic in parse_constrs
1 parent 358a1ae commit dd9b6dc

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/comp/front/parser.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -336,19 +336,14 @@ fn parse_constrs(parser p) -> common.spanned[vec[@ast.constr]] {
336336
let vec[@ast.constr] constrs = vec();
337337
if (p.peek() == token.COLON) {
338338
p.bump();
339-
let bool more = true;
340-
while (more) {
341-
alt (p.peek()) {
342-
case (token.IDENT(_)) {
343-
auto constr = parse_ty_constr(p);
344-
hi = constr.span.hi;
345-
Vec.push[@ast.constr](constrs, constr);
346-
if (p.peek() == token.COMMA) {
347-
p.bump();
348-
more = false;
349-
}
350-
}
351-
case (_) { more = false; }
339+
while (true) {
340+
auto constr = parse_ty_constr(p);
341+
hi = constr.span.hi;
342+
Vec.push[@ast.constr](constrs, constr);
343+
if (p.peek() == token.COMMA) {
344+
p.bump();
345+
} else {
346+
break;
352347
}
353348
}
354349
}

0 commit comments

Comments
 (0)