mirror of
https://github.com/janet-lang/janet
synced 2025-02-05 03:30:02 +00:00
Rename predicates in module/paths
This commit is contained in:
parent
27b1f59aa9
commit
8655530b19
@ -2618,9 +2618,9 @@
|
|||||||
[image]
|
[image]
|
||||||
(unmarshal image load-image-dict))
|
(unmarshal image load-image-dict))
|
||||||
|
|
||||||
(defn- check-. [x] (if (string/has-prefix? "." x) x))
|
(defn- check-relative [x] (if (string/has-prefix? "." x) x))
|
||||||
(defn- not-check-. [x] (unless (or (string/has-prefix? "/" x) (string/has-prefix? "." x)) x))
|
(defn- check-is-dep [x] (unless (or (string/has-prefix? "/" x) (string/has-prefix? "." x)) x))
|
||||||
(defn- check-/ [x] (if (string/has-prefix? "/" x) x))
|
(defn- check-project-relative [x] (if (string/has-prefix? "/" x) x))
|
||||||
|
|
||||||
(def module/paths
|
(def module/paths
|
||||||
```
|
```
|
||||||
@ -2657,11 +2657,11 @@
|
|||||||
[pre]
|
[pre]
|
||||||
(or (find-index |(and (string? ($ 0)) (string/has-prefix? pre ($ 0))) module/paths) 0))
|
(or (find-index |(and (string? ($ 0)) (string/has-prefix? pre ($ 0))) module/paths) 0))
|
||||||
(def all-index (find-prefix ".:all:"))
|
(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:"))
|
(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:"))
|
(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/paths)
|
||||||
|
|
||||||
(module/add-paths ":native:" :native)
|
(module/add-paths ":native:" :native)
|
||||||
@ -2720,9 +2720,9 @@
|
|||||||
|
|
||||||
(undef fexists)
|
(undef fexists)
|
||||||
(undef mod-filter)
|
(undef mod-filter)
|
||||||
(undef check-.)
|
(undef check-relative)
|
||||||
(undef not-check-.)
|
(undef check-project-relative)
|
||||||
(undef check-/)
|
(undef check-is-dep)
|
||||||
|
|
||||||
(def module/loading
|
(def module/loading
|
||||||
`Table mapping currently loading modules to true. Used to prevent
|
`Table mapping currently loading modules to true. Used to prevent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user