aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authormryouse2022-07-21 02:07:55 +0000
committermryouse2022-07-21 02:07:55 +0000
commitdbcffa42e269cddf659a7f6c70f4abc082dbf67f (patch)
tree695c00b40dc0f77ae0a8709131705de6a63e2647 /libs
parente9f5b77b73fee1a693b3ce61f5b8e3a4922f0efb (diff)
s/*-char/*/
Diffstat (limited to 'libs')
-rw-r--r--libs/regex.neb24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/regex.neb b/libs/regex.neb
index a4460ec..af36830 100644
--- a/libs/regex.neb
+++ b/libs/regex.neb
@@ -12,34 +12,34 @@
(func .match-? :bool (pattern text)
(or
(and
- (.match-one (first-char pattern) (first-char text))
- (.match-inner (rest-char (rest-char pattern)) (rest-char text)))
- (.match-inner (rest-char (rest-char pattern)) text)))
+ (.match-one (first pattern) (first text))
+ (.match-inner (rest (rest pattern)) (rest text)))
+ (.match-inner (rest (rest pattern)) text)))
(func .match-* (pattern text)
(or
(and
- (.match-one (first-char pattern) (first-char text))
- (.match-inner pattern (rest-char text)))
- (.match-inner (rest-char (rest-char pattern)) text)))
+ (.match-one (first pattern) (first text))
+ (.match-inner pattern (rest text)))
+ (.match-inner (rest (rest pattern)) text)))
(func .match-inner (pattern text)
(branch
((eq? "" pattern) #true)
((and (eq? "$" pattern) (eq? "" text)) #true)
((eq? "" text) #false)
- ((and (>= (length pattern) 2) (eq? "?" (first-char (rest-char pattern))))
+ ((and (>= (length pattern) 2) (eq? "?" (first (rest pattern))))
(.match-? pattern text))
- ((and (>= (length pattern) 2) (eq? "*" (first-char (rest-char pattern))))
+ ((and (>= (length pattern) 2) (eq? "*" (first (rest pattern))))
(.match-* pattern text))
(#true
(and
- (.match-one (first-char pattern) (first-char text))
- (.match-inner (rest-char pattern) (rest-char text))))))
+ (.match-one (first pattern) (first text))
+ (.match-inner (rest pattern) (rest text))))))
(func .search (pattern text)
- (if (eq? "^" (first-char pattern))
- (.match-inner (rest-char pattern) text)
+ (if (eq? "^" (first pattern))
+ (.match-inner (rest pattern) text)
;(.match-inner (concat ".*" pattern) text))) ; this is elegant but requires going through the entire string
(block
(def seed (list))