From 645d0c06e541b57cf1b87877856f592c6fbf49ee Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 5 Nov 2022 19:50:31 -0400 Subject: feat(tvix/eval): Add a proc-macro for defining builtins Add a single new proc macro to a new proc-macro crate, `tvix-eval-proc-macros` for defining an inline module containing nix builtins, and automatically generating a function within that module which returns a list of those builtins as `tvix_eval::value::Builtin`. Change-Id: Ie4afae438914d2af93d15637151a49b4c68aa352 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7198 Reviewed-by: tazjin Reviewed-by: Adam Joseph Tested-by: BuildkiteCI --- tvix/eval/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/eval/src/lib.rs') diff --git a/tvix/eval/src/lib.rs b/tvix/eval/src/lib.rs index 00f680bc7a2e..4dd324f62eae 100644 --- a/tvix/eval/src/lib.rs +++ b/tvix/eval/src/lib.rs @@ -27,12 +27,12 @@ use std::rc::Rc; // Re-export the public interface used by other crates. pub use crate::builtins::global_builtins; pub use crate::compiler::{compile, prepare_globals}; -pub use crate::errors::EvalResult; +pub use crate::errors::{ErrorKind, EvalResult}; pub use crate::eval::{interpret, Options}; pub use crate::pretty_ast::pretty_print_expr; pub use crate::source::SourceCode; -pub use crate::value::Value; -pub use crate::vm::run_lambda; +pub use crate::value::{Builtin, Value}; +pub use crate::vm::{run_lambda, VM}; // TODO: use Rc::unwrap_or_clone once it is stabilised. // https://doc.rust-lang.org/std/rc/struct.Rc.html#method.unwrap_or_clone -- cgit 1.4.1