dad07a8bc0
Some new top-level re-exports (specifically VM, Builtin, and ErrorKind) were added to lib.rs in tvix/eval to allow the builtin-macros tests to work - we should be clear which of these are part of the public interface (I think it's reasonable for ErrorKind to be) and which aren't (specifically I'm not sure VM and Builtin necessarily should be, at least yet). Change-Id: I3bbeaa63cdda9227224cd3bc298a9bb8da4deb7c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7203 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
25 lines
568 B
Rust
25 lines
568 B
Rust
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);
|
|
}
|