2020-03-18 05:04:26 +01:00
|
|
|
#![cfg_attr(feature = "no_std", no_std)]
|
|
|
|
|
2020-03-24 02:49:08 +01:00
|
|
|
use rhai::{Engine, EvalAltResult, INT};
|
2020-03-18 05:04:26 +01:00
|
|
|
|
|
|
|
fn main() -> Result<(), EvalAltResult> {
|
|
|
|
let mut engine = Engine::new();
|
|
|
|
|
2020-03-24 02:49:08 +01:00
|
|
|
let result = engine.eval::<INT>("40 + 2")?;
|
2020-03-18 05:04:26 +01:00
|
|
|
|
2020-03-24 02:49:08 +01:00
|
|
|
println!("Answer: {}", 42);
|
2020-03-18 05:04:26 +01:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|