diff options
| author | Benjamin Herr <ben@0x539.de> | 2013-10-02 03:32:29 +0200 |
|---|---|---|
| committer | Benjamin Herr <ben@0x539.de> | 2013-10-08 01:44:05 +0200 |
| commit | 97878725532c4d1dd1af07e88175462178d78cdb (patch) | |
| tree | 22bbce6a302b11127fb7db196995affa8f272b3f /src/libsyntax/ext | |
| parent | 18099fe085535d3d026db1a771c115b7a7ba6563 (diff) | |
| download | rust-97878725532c4d1dd1af07e88175462178d78cdb.tar.gz rust-97878725532c4d1dd1af07e88175462178d78cdb.zip | |
add token::LIT_STR_RAW(ident, num of # symbols)
Treat it as a synonym for LIT_STR for now.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 3b4be1de3e8..5a3c3a86fed 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -437,7 +437,8 @@ pub fn get_single_str_from_tts(cx: @ExtCtxt, } match tts[0] { - ast::tt_tok(_, token::LIT_STR(ident)) => cx.str_of(ident), + ast::tt_tok(_, token::LIT_STR(ident)) + | ast::tt_tok(_, token::LIT_STR_RAW(ident, _)) => cx.str_of(ident), _ => cx.span_fatal(sp, format!("{} requires a string.", name)), } } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index bfd1e9cc994..59d55933fa3 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -464,6 +464,13 @@ fn mk_token(cx: @ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr { ~[mk_ident(cx, sp, ident)]); } + LIT_STR_RAW(ident, n) => { + return cx.expr_call_ident(sp, + id_ext("LIT_STR_RAW"), + ~[mk_ident(cx, sp, ident), + cx.expr_uint(sp, n)]); + } + IDENT(ident, b) => { return cx.expr_call_ident(sp, id_ext("IDENT"), |
