about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-05T09·43+0300
committertazjin <tazjin@tvl.su>2023-01-06T12·23+0000
commit5926a05f4663bd11cef64598d1604b61fb60bede (patch)
tree4b47e9b769a44a9b3278ec5f2a36ca4c453c6342 /tvix/eval/src/compiler
parent27fecee1bca2ef92a46912b5787d62d86ce02c45 (diff)
feat(tvix/eval): add Evaluation::compile_only method r/5599
This would make it possible to implement something like a linter based
on the tvix-eval compiler warnings.

Change-Id: I1feb4e7c4a44be7d1204b0a962ab522fd32b93c6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7763
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 4a44f95691..efebd22770 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -47,6 +47,8 @@ pub struct CompilationOutput {
 
     // This field must outlive the rc::Weak reference which breaks
     // the builtins -> import -> builtins reference cycle.
+    //
+    // TODO: ensure through compiler
     pub globals: Rc<GlobalsMap>,
 }
 
@@ -82,7 +84,7 @@ pub type Global = Rc<dyn Fn(&mut Compiler, Span)>;
 
 /// The map of globally available functions that should implicitly
 /// be resolvable in the global scope.
-type GlobalsMap = HashMap<&'static str, Rc<dyn Fn(&mut Compiler, Span)>>;
+pub(crate) type GlobalsMap = HashMap<&'static str, Rc<dyn Fn(&mut Compiler, Span)>>;
 
 /// Set of builtins that (if they exist) should be made available in
 /// the global scope, meaning that they can be accessed not just