cppshift 0.1.0

CPP parser and transpiler
Documentation
use cppshift::Lexer;
use miette::Error;

use crate::common::Sources;

mod common;

fn main() -> Result<(), Error> {
    for source in Sources::default() {
        if let Ok(source_content) = source.read_to_string() {
            println!("Source file {}:", source.to_str().unwrap_or("<unknown>"));
            for token in Lexer::new(&source_content) {
                println!("{:?}", token?);
            }
        } else if let Some(path) = source.to_str() {
            eprintln!("Can't read source file `{:?}`", path);
        } else {
            eprintln!("Can't read source file");
        }
    }

    Ok(())
}