about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index b1ea408a8ca4..4f3c93ec1451 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -355,6 +355,13 @@ mod pure_builtins {
         Ok(json_str.into())
     }
 
+    #[builtin("fromTOML")]
+    fn builtin_from_toml(_: &mut VM, toml: Value) -> Result<Value, ErrorKind> {
+        let toml_str = toml.to_str()?;
+
+        toml::from_str(&toml_str).map_err(|err| err.into())
+    }
+
     #[builtin("genericClosure")]
     fn builtin_generic_closure(vm: &mut VM, input: Value) -> Result<Value, ErrorKind> {
         let attrs = input.to_attrs()?;