diff options
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 2 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index bdd6fa07..2ae4c907 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -55,7 +55,7 @@ type pat = spanned[pat_]; tag pat_ { pat_wild(ann); pat_bind(ident, def_id, ann); - pat_tag(ident, vec[@pat], option.t[variant_def], ann); + pat_tag(path, vec[@pat], option.t[variant_def], ann); } tag mutability { diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 5a67efa6..5444e5fd 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1071,7 +1071,7 @@ impure fn parse_pat(parser p) -> @ast.pat { } } case (token.IDENT(?id)) { - p.bump(); + auto tag_path = parse_path(p, GREEDY); let vec[@ast.pat] args; alt (p.peek()) { @@ -1083,7 +1083,8 @@ impure fn parse_pat(parser p) -> @ast.pat { case (_) { args = vec(); } } - pat = ast.pat_tag(id, args, none[ast.variant_def], ast.ann_none); + pat = ast.pat_tag(tag_path, args, none[ast.variant_def], + ast.ann_none); } case (?tok) { p.err("expected pattern but found " + token.to_str(tok)); |