about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/front/parser.rs21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index fb43188af50..2295e4788fe 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -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;
             }
         }
     }