diff --git a/examples/macro_easy.reid b/examples/macro_easy.reid index def121f..c67567e 100644 --- a/examples/macro_easy.reid +++ b/examples/macro_easy.reid @@ -2,8 +2,7 @@ import std::String; import std::print; fn main() -> u8 { - // - TODO possibly allow to cast between &[ty] and *ty - let bytes = test_macro!("./macro_easy_file.txt"); + let bytes = include_bytes!("./macro_easy_file.txt"); print(String::new() + bytes.length()); return (bytes as *u8)[0]; } diff --git a/reid/src/mir/macros.rs b/reid/src/mir/macros.rs index 8d7bd4b..c87957c 100644 --- a/reid/src/mir/macros.rs +++ b/reid/src/mir/macros.rs @@ -212,14 +212,14 @@ impl mir::Expression { pub fn form_macros() -> HashMap> { let mut macros: HashMap> = HashMap::new(); - macros.insert("test_macro".to_owned(), Box::new(TestMacro)); + macros.insert("include_bytes".to_owned(), Box::new(IncludeBytes)); macros } #[derive(Debug)] -pub struct TestMacro; -impl MacroFunction for TestMacro { +pub struct IncludeBytes; +impl MacroFunction for IncludeBytes { fn generate<'ctx, 'a>( &self, module: &MacroModule,