Rename predicates in module/paths

This commit is contained in:
Calvin Rose 2020-12-29 19:52:26 -06:00
parent 27b1f59aa9
commit 8655530b19
1 changed files with 9 additions and 9 deletions

View File

@ -2618,9 +2618,9 @@
[image]
(unmarshal image load-image-dict))
(defn- check-. [x] (if (string/has-prefix? "." x) x))
(defn- not-check-. [x] (unless (or (string/has-prefix? "/" x) (string/has-prefix? "." x)) x))
(defn- check-/ [x] (if (string/has-prefix? "/" x) x))
(defn- check-relative [x] (if (string/has-prefix? "." x) x))
(defn- check-is-dep [x] (unless (or (string/has-prefix? "/" x) (string/has-prefix? "." x)) x))
(defn- check-project-relative [x] (if (string/has-prefix? "/" x) x))
(def module/paths
```
@ -2657,11 +2657,11 @@
[pre]
(or (find-index |(and (string? ($ 0)) (string/has-prefix? pre ($ 0))) module/paths) 0))
(def all-index (find-prefix ".:all:"))
(array/insert module/paths all-index [(string ".:all:" ext) loader check-/])
(array/insert module/paths all-index [(string ".:all:" ext) loader check-project-relative])
(def sys-index (find-prefix ":sys:"))
(array/insert module/paths sys-index [(string ":sys:/:all:" ext) loader not-check-.])
(array/insert module/paths sys-index [(string ":sys:/:all:" ext) loader check-is-dep])
(def curall-index (find-prefix ":cur:/:all:"))
(array/insert module/paths curall-index [(string ":cur:/:all:" ext) loader check-.])
(array/insert module/paths curall-index [(string ":cur:/:all:" ext) loader check-relative])
module/paths)
(module/add-paths ":native:" :native)
@ -2720,9 +2720,9 @@
(undef fexists)
(undef mod-filter)
(undef check-.)
(undef not-check-.)
(undef check-/)
(undef check-relative)
(undef check-project-relative)
(undef check-is-dep)
(def module/loading
`Table mapping currently loading modules to true. Used to prevent