about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-11-06T15·07-0500
committergrfn <grfn@gws.fyi>2022-11-08T13·42+0000
commitdad07a8bc0369932a7b65efc2dd4181a8863eb5b (patch)
tree6362a523534bd12bf95b2ccb7213aa572d99fe4f /tvix/eval/src
parenta4c9cc8d5e9edeaaf77bc35ebc5c3a8fa0200977 (diff)
refactor(tvix/eval): Be clearer about public interface r/5267
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>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/lib.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/tvix/eval/src/lib.rs b/tvix/eval/src/lib.rs
index 4dd324f62eae..106f7d851cd3 100644
--- a/tvix/eval/src/lib.rs
+++ b/tvix/eval/src/lib.rs
@@ -31,8 +31,15 @@ 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::{Builtin, Value};
-pub use crate::vm::{run_lambda, VM};
+pub use crate::value::Value;
+pub use crate::vm::run_lambda;
+
+/// Internal-only parts of `tvix-eval`, exported for use in macros, but not part of the public
+/// interface of the crate.
+pub mod internal {
+    pub use crate::value::Builtin;
+    pub use crate::vm::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