Remove some truly wrong logic in parse_constrs
This commit is contained in:
parent
358a1aeec9
commit
dd9b6dccb4
1 changed files with 8 additions and 13 deletions
|
|
@ -336,19 +336,14 @@ fn parse_constrs(parser p) -> common.spanned[vec[@ast.constr]] {
|
|||
let vec[@ast.constr] constrs = vec();
|
||||
if (p.peek() == token.COLON) {
|
||||
p.bump();
|
||||
let bool more = true;
|
||||
while (more) {
|
||||
alt (p.peek()) {
|
||||
case (token.IDENT(_)) {
|
||||
auto constr = parse_ty_constr(p);
|
||||
hi = constr.span.hi;
|
||||
Vec.push[@ast.constr](constrs, constr);
|
||||
if (p.peek() == token.COMMA) {
|
||||
p.bump();
|
||||
more = false;
|
||||
}
|
||||
}
|
||||
case (_) { more = false; }
|
||||
while (true) {
|
||||
auto constr = parse_ty_constr(p);
|
||||
hi = constr.span.hi;
|
||||
Vec.push[@ast.constr](constrs, constr);
|
||||
if (p.peek() == token.COMMA) {
|
||||
p.bump();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue