diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-28 02:01:44 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-28 15:55:37 +1100 |
| commit | cd049591a25973cd41ca5b69e7a151ae5fa0b71f (patch) | |
| tree | e2c5dc3408d805d9bb4a2cfa0b4cdb0d64080749 /src/libsyntax/ext | |
| parent | fcb78d65f2a3b553b9aaca762910daf10fbb1dce (diff) | |
| download | rust-cd049591a25973cd41ca5b69e7a151ae5fa0b71f.tar.gz rust-cd049591a25973cd41ca5b69e7a151ae5fa0b71f.zip | |
Use an enum rather than a bool in token::Ident
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 39a538f917b..dc7a495523f 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -531,6 +531,7 @@ fn mk_binop(cx: &ExtCtxt, sp: Span, bop: token::BinOpToken) -> P<ast::Expr> { mk_token_path(cx, sp, name) } +#[allow(non_uppercase_statics)] // NOTE(stage0): remove this attribute after the next snapshot fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> { match *tok { token::BinOp(binop) => { @@ -575,10 +576,14 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> { vec!(mk_name(cx, sp, ident.ident()), cx.expr_uint(sp, n))); } - token::Ident(ident, b) => { + token::Ident(ident, style) => { return cx.expr_call(sp, mk_token_path(cx, sp, "Ident"), - vec!(mk_ident(cx, sp, ident), cx.expr_bool(sp, b))); + vec![mk_ident(cx, sp, ident), + match style { + ModName => mk_token_path(cx, sp, "ModName"), + Plain => mk_token_path(cx, sp, "Plain"), + }]); } token::Lifetime(ident) => { |
