]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/source_util.rs
Merge remote-tracking branch 'brson/codemap'
[rust.git] / src / libsyntax / ext / source_util.rs
index 93cfaadcbd378eed83c19a48d42dfd3b02a8f3c5..baf92175e7d6b5be4b7aa603217dd02d9ca2c092 100644 (file)
@@ -57,20 +57,18 @@ fn expand_mod(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body)
 fn expand_include(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
                   _body: ast::mac_body) -> @ast::expr {
     let args = get_mac_args(cx, sp, arg, 1u, option::Some(1u), ~"include");
-    let file = expr_to_str(cx, args[0], ~"#include_str requires a string");
-    let p = parse::new_parser_from_file(
-        cx.parse_sess(), cx.cfg(),
-        &res_rel_file(cx, sp, &Path(file)),
-        parse::parser::SOURCE_FILE);
-    let e = p.parse_expr();
-    return e;
+    let file = expr_to_str(cx, args[0], ~"include_str! requires a string");
+    let p = parse::new_parser_from_file(cx.parse_sess(), cx.cfg(),
+                                        &res_rel_file(cx, sp, &Path(file)),
+                                        parse::parser::SOURCE_FILE);
+    return p.parse_expr();
 }
 
 fn expand_include_str(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),~"include_str");
 
-    let file = expr_to_str(cx, args[0], ~"#include_str requires a string");
+    let file = expr_to_str(cx, args[0], ~"include_str! requires a string");
 
     let res = io::read_whole_file_str(&res_rel_file(cx, sp, &Path(file)));
     match res {
@@ -87,7 +85,7 @@ fn expand_include_bin(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),~"include_bin");
 
-    let file = expr_to_str(cx, args[0], ~"#include_bin requires a string");
+    let file = expr_to_str(cx, args[0], ~"include_bin! requires a string");
 
     match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) {
       result::Ok(src) => {