diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-13 10:50:16 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-13 10:50:16 +0200 |
| commit | 6cb5c0980a14aaad0c676a88160726de52cac456 (patch) | |
| tree | fedeab05fa4ac7578c99351c14bf4cda12079225 /src/comp/syntax/parse/parser.rs | |
| parent | 6914d32accd7cc3c29697bf0e2974e654558fe07 (diff) | |
| download | rust-6cb5c0980a14aaad0c676a88160726de52cac456.tar.gz rust-6cb5c0980a14aaad0c676a88160726de52cac456.zip | |
box patterns, expect for the trans part
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index ba6813cd6ce..fb9eca8640d 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1459,6 +1459,12 @@ fn parse_pat(&parser p) -> @ast::pat { } } } + case (token::AT) { + p.bump(); + auto sub = parse_pat(p); + pat = ast::pat_box(sub); + hi = sub.span.hi; + } case (token::LBRACE) { p.bump(); auto fields = ~[]; @@ -2313,9 +2319,8 @@ fn parse_rest_import_name(&parser p, ast::ident first, } alt (p.peek()) { case (token::IDENT(_, _)) { identifiers += ~[parse_ident(p)]; } - case ( - //the lexer can't tell the different kinds of stars apart ) : - token::BINOP(token::STAR)) { + //the lexer can't tell the different kinds of stars apart ) : + case (token::BINOP(token::STAR)) { glob = true; p.bump(); } |
