diff options
Diffstat (limited to 'src/libsyntax/ext/ident_to_str.rs')
| -rw-r--r-- | src/libsyntax/ext/ident_to_str.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/ext/ident_to_str.rs b/src/libsyntax/ext/ident_to_str.rs new file mode 100644 index 00000000000..7dfb70f1520 --- /dev/null +++ b/src/libsyntax/ext/ident_to_str.rs @@ -0,0 +1,11 @@ +import base::*; +import option; + +fn expand_syntax_ext(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg, + _body: ast::mac_body) -> @ast::expr { + let args = get_mac_args(cx,sp,arg,1u,option::some(1u),"ident_to_str"); + + ret make_new_lit(cx, sp, + ast::lit_str(expr_to_ident(cx, args[0u], + "expected an ident"))); +} |
