summaryrefslogtreecommitdiff
path: root/modules/language/python/string.scm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/language/python/string.scm')
-rw-r--r--modules/language/python/string.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/language/python/string.scm b/modules/language/python/string.scm
index 829e3a2..a560801 100644
--- a/modules/language/python/string.scm
+++ b/modules/language/python/string.scm
@@ -380,21 +380,22 @@
(define-py (py-split split s . l)
(define ws (f+ (f-reg "[ \t\n]")))
- (define r
+ (define (r ws)
(f-or! (f-seq f-eof (f-out '()))
- (f-cons (f-seq (mk-token (f* (f-reg! "."))) f-eof) (f-out '()))))
+ (f-cons (f-seq (f? ws) (mk-token (f* (f-reg! "."))) f-eof)
+ (f-out '()))))
(define (u ws) (mk-token (f+ (f-not! ws))))
(define (tok ws i)
(if (= i 0)
(f-list (mk-token (f* (f-reg! "."))))
(let ((e (mk-token (f* (f-not! ws)))))
(f-seq (f? ws)
- (f-cons e
+ (f-cons* e
(let lp ((i i))
(if (> (- i 1) 0)
(f-or! (f-seq (f? ws) f-eof (f-out '()))
(f-cons (f-seq ws e) (Ds (lp (- i 1)))))
- r)))))))
+ (r ws))))))))
(define N 1000000000000)
(let ((e (call-with-values