summaryrefslogblamecommitdiff
path: root/src/macro_processor/main.rs
blob: 2d34952a343a0fffab177bfb339c9d040e925f82 (plain) (tree)
1
2
3
4
5
6
                                                

             


                                                  






                                                                         
 
                                                    



                                                      
 
use skaldpress::macro_processor::MacroProcessor;
use std::env;
use std::fs;

fn main() {
    let args: Vec<String> = env::args().collect();
    let input_file = match fs::read_to_string(&args[1]) {
        Ok(x) => x,
        Err(e) => {
            println!("Could not read input-file \"{}\": {}", args[1], e);
            std::process::exit(1);
        }
    };

    let mut macro_processor = MacroProcessor::new();
    match macro_processor.process_input(&input_file) {
        Ok(out) => println!("{}", out),
        Err(e) => println!("Error {}", e),
    }
}