From 6bf9f894293e224cc99f61f92f22dc134e66f552 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Mon, 29 Nov 2021 10:05:04 +0900 Subject: [PATCH] Update location of current file in run-context --- src/boot/boot.janet | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 54c3bbeb..380f2863 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -2292,6 +2292,8 @@ (var where default-where) + (unless (= where "") (put env :current-file where)) + # Evaluate 1 source form in a protected manner (def lints @[]) (defn eval1 [source &opt l c] @@ -2370,8 +2372,12 @@ [:source new-where] (if (string? new-where) - (set where new-where) - (set where default-where)) + (do + (set where new-where) + (put env :current-file new-where)) + (do + (set where default-where) + (put env :current-file nil))) (do (var pindex 0)