blob: d07020f69bb799a5152d0a98d8f38597f379f9e1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
pub use tvix_eval::internal;
pub use tvix_eval::Value;
use tvix_eval_builtin_macros::builtins;
#[builtins]
mod builtins {
use tvix_eval::internal::VM;
use tvix_eval::{ErrorKind, Value};
#[builtin("identity")]
pub fn builtin_identity(_vm: &mut VM, x: Value) -> Result<Value, ErrorKind> {
Ok(x)
}
#[builtin("tryEval")]
pub fn builtin_try_eval(_: &mut VM, #[lazy] _x: Value) -> Result<Value, ErrorKind> {
todo!()
}
}
#[test]
fn builtins() {
let builtins = builtins::builtins();
assert_eq!(builtins.len(), 2);
}
|