diff options
Diffstat (limited to 'src/librustsyntax/ext/source_util.rs')
| -rw-r--r-- | src/librustsyntax/ext/source_util.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustsyntax/ext/source_util.rs b/src/librustsyntax/ext/source_util.rs index 7b3471d03b4..ba3ab3342c6 100644 --- a/src/librustsyntax/ext/source_util.rs +++ b/src/librustsyntax/ext/source_util.rs @@ -3,7 +3,6 @@ import ast; import codemap::span; import print::pprust; - /* #line(): expands to the current line number */ fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { @@ -46,3 +45,9 @@ fn expand_include(cx: ext_ctxt, sp: span, arg: ast::mac_arg, parse::parser::SOURCE_FILE); ret parse::parser::parse_expr(p) } + +fn expand_mod(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) + -> @ast::expr { + get_mac_args(cx, sp, arg, 0u, option::some(0u), "file"); + ret make_new_lit(cx, sp, ast::lit_str(str::connect(cx.mod_path(), "::"))); +} |
