about summary refs log tree commit diff
path: root/tvix/eval/src/builtins/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r--tvix/eval/src/builtins/mod.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 7c4f40479bc2..b2344a422e63 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -982,6 +982,30 @@ fn placeholders() -> Vec<Builtin> {
             },
         ),
         Builtin::new(
+            "unsafeGetAttrPos",
+            &[
+                BuiltinArgument {
+                    strict: true,
+                    name: "name",
+                },
+                BuiltinArgument {
+                    strict: true,
+                    name: "attrset",
+                },
+            ],
+            None,
+            |mut args: Vec<Value>, vm: &mut VM| {
+                vm.emit_warning(WarningKind::NotImplemented("builtins.unsafeGetAttrsPos"));
+                let _attrset = args.pop().unwrap().to_attrs();
+                let _name = args.pop().unwrap().to_str();
+                let mut res: BTreeMap<NixString, Value> = BTreeMap::new();
+                res.insert("line".into(), 42.into());
+                res.insert("col".into(), 42.into());
+                res.insert("file".into(), Value::Path("/deep/thought".into()));
+                Ok(Value::attrs(NixAttrs::from_map(res)))
+            },
+        ),
+        Builtin::new(
             "derivation",
             &[BuiltinArgument {
                 strict: true,