carlo_run/lib.rs
1//! Defines the RUN subcommand.
2
3use carlotk::prelude::*;
4
5const HELP: &str = include_str!("../help_run.txt");
6
7/// Provide help to the user
8pub fn helpme() {
9 printhelp(HELP);
10}
11
12pub fn run(args: CliArgs) {
13 if args.contains(Flag::Help) {
14 printhelp(HELP);
15 }
16
17 let inputfile = args.inputfile.clone();
18 let debug = args.contains(Flag::Debug);
19 let expressions = parse(inputfile, debug);
20 let mut env = Environment::new();
21 let output = env.evaluate(&expressions);
22 println!("{}", output);
23}