diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-08-15 15:35:40 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-08-15 15:44:41 -0700 |
| commit | 814bf41d898cd0410873f6c05c03a2b34366bfde (patch) | |
| tree | c281eaf689a64894ca2ac50ab00d69db4394d570 /src/comp/syntax/parse | |
| parent | 9ca8df93b318aa4dc721a187f1216ac7f3a6671b (diff) | |
| download | rust-814bf41d898cd0410873f6c05c03a2b34366bfde.tar.gz rust-814bf41d898cd0410873f6c05c03a2b34366bfde.zip | |
Add operator 'copy', translates as fall-through.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 19f058d7ee2..86d61ba1f94 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -180,6 +180,7 @@ fn bad_expr_word_table() -> hashmap[str, ()] { words.insert("log_err", ()); words.insert("tag", ()); words.insert("obj", ()); + words.insert("copy", ()); ret words; } @@ -999,6 +1000,10 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr { hi = e.span.hi; expect(p, token::RPAREN); ex = ast::expr_chan(e); + } else if (eat_word(p, "copy")) { + let e = parse_expr(p); + ex = ast::expr_copy(e); + hi = e.span.hi; } else if (eat_word(p, "self")) { log "parsing a self-call..."; expect(p, token::DOT); |
