diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-01-27 15:25:07 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-01-27 15:27:56 -0500 |
| commit | 5066937f108cf364cb31bdd517bf3d984ecec73d (patch) | |
| tree | d04e5f00286ef90700ee39a71932c8e255664cbc /src/comp/front/parser.rs | |
| parent | Fix documentation: aliases may not be used in loop constructs. (diff) | |
| download | rust-5066937f108cf364cb31bdd517bf3d984ecec73d.tar.xz rust-5066937f108cf364cb31bdd517bf3d984ecec73d.zip | |
First step for supporting "case (foo.bar(?zed))": Change the ast of
pat_tag to hold a path.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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)); |