Rename macro to include_bytes!()
This commit is contained in:
		
							parent
							
								
									7234cad5f0
								
							
						
					
					
						commit
						2303bf757a
					
				| @ -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]; | ||||
| } | ||||
|  | ||||
| @ -212,14 +212,14 @@ impl mir::Expression { | ||||
| pub fn form_macros() -> HashMap<String, Box<dyn MacroFunction>> { | ||||
|     let mut macros: HashMap<String, Box<dyn MacroFunction>> = 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, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user