about summary refs log tree commit diff
path: root/tvix/eval/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/main.rs')
-rw-r--r--tvix/eval/src/main.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/tvix/eval/src/main.rs b/tvix/eval/src/main.rs
index 0c4d082783e2..3d0c29688e6d 100644
--- a/tvix/eval/src/main.rs
+++ b/tvix/eval/src/main.rs
@@ -1,4 +1,8 @@
-use std::{env, fs, path::PathBuf, process};
+use std::{
+    env, fs,
+    path::{Path, PathBuf},
+    process,
+};
 
 use rustyline::{error::ReadlineError, Editor};
 
@@ -18,8 +22,9 @@ fn main() {
 
 fn run_file(file: &str) {
     let contents = fs::read_to_string(file).expect("failed to read the input file");
+    let path = Path::new(file).to_owned();
 
-    match tvix_eval::interpret(&contents) {
+    match tvix_eval::interpret(&contents, Some(path)) {
         Ok(result) => println!("=> {} :: {}", result, result.type_of()),
         Err(err) => eprintln!("{}", err),
     }
@@ -53,7 +58,7 @@ fn run_prompt() {
                     continue;
                 }
 
-                match tvix_eval::interpret(&line) {
+                match tvix_eval::interpret(&line, None) {
                     Ok(result) => {
                         println!("=> {} :: {}", result, result.type_of());
                         rl.add_history_entry(line);