feat: most basic cli
co-authored by electria
This commit is contained in:
parent
06aaf8cb8a
commit
580300a205
2 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
use std::env;
|
||||
|
||||
mod parse;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
println!("{}", parse::parse(env::args().nth(1).unwrap().as_ref()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -313,6 +313,10 @@ fn nodes_to_num(mut nodes: Vec<Node>) -> Float {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn parse(s: &str) -> Float {
|
||||
nodes_to_num(nodes_from_str(s).unwrap())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_nodes_to_num() {
|
||||
assert_eq!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue