2022-04-14 04:50:37 +00:00
|
|
|
use std::fs::File;
|
|
|
|
use clap::Parser;
|
|
|
|
|
2022-06-03 16:06:20 +00:00
|
|
|
pub mod vcd;
|
|
|
|
use vcd::*;
|
2022-06-03 00:02:09 +00:00
|
|
|
|
2022-04-14 04:50:37 +00:00
|
|
|
#[derive(Parser)]
|
|
|
|
struct Cli {
|
|
|
|
/// The path to the file to read
|
|
|
|
#[clap(parse(from_os_str))]
|
2022-05-21 02:52:26 +00:00
|
|
|
path: std::path::PathBuf}
|
2022-04-14 04:50:37 +00:00
|
|
|
|
2022-05-19 02:57:42 +00:00
|
|
|
fn main() -> std::io::Result<()> {
|
|
|
|
let args = Cli::parse();
|
|
|
|
|
2022-05-19 07:44:24 +00:00
|
|
|
let file = File::open(&args.path)?;
|
2022-06-13 02:52:24 +00:00
|
|
|
// dbg!(take_while("01234hello", digit));
|
|
|
|
|
2022-06-09 01:45:47 +00:00
|
|
|
// dbg!(["hello", "goodbye", "myworld"].contains(&"myworlde"));
|
2022-06-04 01:06:46 +00:00
|
|
|
// let mut word_gen = WordReader::new(file);
|
|
|
|
// let mut word_count = 0;
|
|
|
|
|
|
|
|
// while word_gen.next_word().is_some() {
|
|
|
|
// word_count += 1;
|
|
|
|
// }
|
|
|
|
// dbg!(word_count);
|
|
|
|
|
|
|
|
// let word1 = "hello world";
|
|
|
|
// let word2 = "hello planet";
|
|
|
|
// dbg!(&word1[0..6].len());
|
2022-06-09 01:45:47 +00:00
|
|
|
parse_vcd(file);
|
2022-06-04 01:06:46 +00:00
|
|
|
|
|
|
|
// tag("my oh my");
|
2022-06-02 20:51:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
// loop {
|
2022-06-03 00:02:09 +00:00
|
|
|
// let word = word_gen.next_word();
|
|
|
|
// if word.is_none() {break};
|
|
|
|
|
|
|
|
// dbg!(word.unwrap());
|
2022-06-02 20:51:56 +00:00
|
|
|
// }
|
|
|
|
|
2022-05-23 03:00:03 +00:00
|
|
|
|
2022-04-14 04:50:37 +00:00
|
|
|
Ok(())
|
2022-05-21 19:22:05 +00:00
|
|
|
}
|