mirror of
				https://github.com/janet-lang/janet
				synced 2025-11-04 01:23:04 +00:00 
			
		
		
		
	Rename predicates in module/paths
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user