1use cel_core::{CelType, Env};
9
10fn main() {
11 let env = Env::with_standard_library()
14 .with_all_extensions()
15 .with_variable("values", CelType::list(CelType::Int))
16 .with_variable("text", CelType::String);
17
18 let ast = env.compile("math.greatest(values)").unwrap();
20 println!("math.greatest(values) type: {:?}", ast.result_type());
21
22 let ast = env.compile("math.least(values)").unwrap();
23 println!("math.least(values) type: {:?}", ast.result_type());
24
25 let ast = env.compile("math.abs(-42)").unwrap();
26 println!("math.abs(-42) type: {:?}", ast.result_type());
27
28 let ast = env.compile("text.split(' ')").unwrap();
30 println!("text.split(' ') type: {:?}", ast.result_type());
31
32 let ast = env.compile("['a', 'b'].join('-')").unwrap();
33 println!("['a','b'].join('-') type: {:?}", ast.result_type());
34
35 println!("\n=== Standard library (fully implemented) ===");
38
39 let ast = env.compile("size(values)").unwrap();
40 println!("size(values) type: {:?}", ast.result_type());
41
42 let ast = env.compile("text.contains('hello')").unwrap();
43 println!("text.contains type: {:?}", ast.result_type());
44
45 let ast = env.compile("text.startsWith('h')").unwrap();
46 println!("text.startsWith type: {:?}", ast.result_type());
47}