feat(tvix/eval): add Evaluation::compile_only method
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>
This commit is contained in:
parent
27fecee1bc
commit
5926a05f46
2 changed files with 101 additions and 49 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue