diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-04-16 04:12:02 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2016-04-24 20:59:44 +0300 |
| commit | 546c052d225d41cd31f610e87a20f15cd0fa8e3c (patch) | |
| tree | d2d1bb3b10895f266c2d5137c7aba8f8515583af /src/libsyntax/ext/quote.rs | |
| parent | 8dbf8f5f0a26a8f80f895294532ad567c156beb3 (diff) | |
| download | rust-546c052d225d41cd31f610e87a20f15cd0fa8e3c.tar.gz rust-546c052d225d41cd31f610e87a20f15cd0fa8e3c.zip | |
syntax: Get rid of token::IdentStyle
Diffstat (limited to 'src/libsyntax/ext/quote.rs')
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 77aeaf8459a..9734b49ba7c 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -72,7 +72,7 @@ pub mod rt { impl ToTokens for ast::Ident { fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> { - vec![TokenTree::Token(DUMMY_SP, token::Ident(*self, token::Plain))] + vec![TokenTree::Token(DUMMY_SP, token::Ident(*self))] } } @@ -646,14 +646,10 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> { cx.expr_usize(sp, n)) } - token::Ident(ident, style) => { + token::Ident(ident) => { return cx.expr_call(sp, mk_token_path(cx, sp, "Ident"), - vec![mk_ident(cx, sp, ident), - match style { - ModName => mk_token_path(cx, sp, "ModName"), - Plain => mk_token_path(cx, sp, "Plain"), - }]); + vec![mk_ident(cx, sp, ident)]); } token::Lifetime(ident) => { @@ -668,19 +664,10 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> { vec!(mk_name(cx, sp, ast::Ident::with_empty_ctxt(ident)))); } - token::MatchNt(name, kind, namep, kindp) => { + token::MatchNt(name, kind) => { return cx.expr_call(sp, mk_token_path(cx, sp, "MatchNt"), - vec!(mk_ident(cx, sp, name), - mk_ident(cx, sp, kind), - match namep { - ModName => mk_token_path(cx, sp, "ModName"), - Plain => mk_token_path(cx, sp, "Plain"), - }, - match kindp { - ModName => mk_token_path(cx, sp, "ModName"), - Plain => mk_token_path(cx, sp, "Plain"), - })); + vec![mk_ident(cx, sp, name), mk_ident(cx, sp, kind)]); } token::Interpolated(_) => panic!("quote! with interpolated token"), @@ -722,7 +709,7 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> { fn statements_mk_tt(cx: &ExtCtxt, tt: &TokenTree, matcher: bool) -> Vec<ast::Stmt> { match *tt { - TokenTree::Token(sp, SubstNt(ident, _)) => { + TokenTree::Token(sp, SubstNt(ident)) => { // tt.extend($ident.to_tokens(ext_cx)) let e_to_toks = |
