1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-26 15:13:16 +00:00

Merge pull request #883 from pyrmont/feature.netrepl-relative-imports

Update location of current file in run-context
This commit is contained in:
Calvin Rose 2021-11-30 14:17:34 -06:00 committed by GitHub
commit 516fa4e49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2292,6 +2292,8 @@
(var where default-where)
(unless (= where "<anonymous>") (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)