diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-25 14:31:56 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-25 14:31:56 +0200 |
| commit | 2884c722fea91866cefda99eb0ba3a4b64dfd94f (patch) | |
| tree | d8e864e4a60b324b78f0aa43f547a27872af2be4 /src/comp/syntax | |
| parent | ea740a8bb0920ca1dc9730e2f4488e0595dbc898 (diff) | |
| download | rust-2884c722fea91866cefda99eb0ba3a4b64dfd94f.tar.gz rust-2884c722fea91866cefda99eb0ba3a4b64dfd94f.zip | |
Step one towards new type param kind syntax
Issue #1067 Needs a snapshot to finalize.
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 6 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 4df2b6ab3cf..9f478f7969f 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1739,7 +1739,11 @@ fn parse_ty_param(p: parser) -> ast::ty_param { alt p.peek() { token::TILDE. { p.bump(); ast::kind_unique } token::AT. { p.bump(); ast::kind_shared } - _ { ast::kind_pinned } + _ { + if eat_word(p, "pinned") { ast::kind_pinned } + else if eat_word(p, "unique") { ast::kind_unique } + else { ast::kind_shared } + } }; ret {ident: parse_ident(p), kind: k}; } diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 91e3f2ffb59..e95ce36252f 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -1193,8 +1193,8 @@ fn print_arg_mode(s: ps, m: ast::mode) { fn print_kind(s: ps, kind: ast::kind) { alt kind { - ast::kind_unique. { word(s.s, "~"); } - ast::kind_shared. { word(s.s, "@"); } + ast::kind_unique. { word_nbsp(s, "unique"); } + ast::kind_pinned. { word_nbsp(s, "pinned"); } _ {/* fallthrough */ } } } |
