29 lines
574 B
Rust
29 lines
574 B
Rust
|
//
|
||
|
// spec.rs
|
||
|
// Copyright (C) 2023 Maxime “pep” Buquet <pep@bouah.net>
|
||
|
// Distributed under terms of the GPLv3+ license.
|
||
|
//
|
||
|
|
||
|
use std::env::args;
|
||
|
use std::fs::File;
|
||
|
use std::io::{self, Read};
|
||
|
use std::process::exit;
|
||
|
|
||
|
use scansion_dsl::parse_spec;
|
||
|
|
||
|
fn main() -> io::Result<()> {
|
||
|
let args: Vec<String> = args().collect();
|
||
|
if args.len() != 2 {
|
||
|
println!("Usage: {} <spec-path>", args[0]);
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
let mut file = File::open(&args[1])?;
|
||
|
let mut contents = String::new();
|
||
|
file.read_to_string(&mut contents)?;
|
||
|
|
||
|
println!("{:?}", parse_spec(&contents));
|
||
|
|
||
|
Ok(())
|
||
|
}
|