about summary refs log tree commit diff
path: root/tvix/eval/builtin-macros
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/builtin-macros
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/builtin-macros')
-rw-r--r--tvix/eval/builtin-macros/src/lib.rs6
-rw-r--r--tvix/eval/builtin-macros/tests/tests.rs9
2 files changed, 7 insertions, 8 deletions
diff --git a/tvix/eval/builtin-macros/src/lib.rs b/tvix/eval/builtin-macros/src/lib.rs
index 18889505e6d4..8e2c4b3f8776 100644
--- a/tvix/eval/builtin-macros/src/lib.rs
+++ b/tvix/eval/builtin-macros/src/lib.rs
@@ -120,10 +120,10 @@ pub fn builtins(_args: TokenStream, item: TokenStream) -> TokenStream {
                 reversed_args.reverse();
 
                 builtins.push(quote_spanned! { builtin_attr.span() => {
-                    crate::value::Builtin::new(
+                    crate::internal::Builtin::new(
                         #name,
                         &[#(#strictness),*],
-                        |mut args: Vec<Value>, vm: &mut VM| {
+                        |mut args: Vec<crate::Value>, vm: &mut crate::internal::VM| {
                             #(let #reversed_args = args.pop().unwrap();)*
                             #fn_name(vm, #(#args),*)
                         }
@@ -134,7 +134,7 @@ pub fn builtins(_args: TokenStream, item: TokenStream) -> TokenStream {
     }
 
     items.push(parse_quote! {
-        pub fn builtins() -> Vec<crate::value::Builtin> {
+        pub fn builtins() -> Vec<crate::internal::Builtin> {
             vec![#(#builtins),*]
         }
     });
diff --git a/tvix/eval/builtin-macros/tests/tests.rs b/tvix/eval/builtin-macros/tests/tests.rs
index 8f3e83b672ef..d07020f69bb7 100644
--- a/tvix/eval/builtin-macros/tests/tests.rs
+++ b/tvix/eval/builtin-macros/tests/tests.rs
@@ -1,12 +1,11 @@
+pub use tvix_eval::internal;
+pub use tvix_eval::Value;
 use tvix_eval_builtin_macros::builtins;
 
-mod value {
-    pub use tvix_eval::Builtin;
-}
-
 #[builtins]
 mod builtins {
-    use tvix_eval::{ErrorKind, Value, VM};
+    use tvix_eval::internal::VM;
+    use tvix_eval::{ErrorKind, Value};
 
     #[builtin("identity")]
     pub fn builtin_identity(_vm: &mut VM, x: Value) -> Result<Value, ErrorKind> {