eval/
eval.rs

1use rscel::{BindContext, CelContext};
2use std::env;
3
4fn main() {
5    let args: Vec<String> = env::args().collect();
6    let mut context = CelContext::new();
7    let mut exec = BindContext::new();
8
9    context.add_program_str("prog", &args[1]).unwrap();
10
11    if args.len() > 2 {
12        exec.bind_params_from_json_obj(args[2].parse().unwrap())
13            .unwrap();
14    }
15
16    let res = context.exec("prog", &exec).unwrap();
17    println!("{}", res);
18}