From fa1af3858f999783b26269ec159fca3d1b8291fd Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Sun, 12 Aug 2018 21:52:45 +0200 Subject: textwrap compiles --- modules/language/python/module/re/parser.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'modules/language/python/module/re/parser.scm') diff --git a/modules/language/python/module/re/parser.scm b/modules/language/python/module/re/parser.scm index 9ecc756..4d603c6 100644 --- a/modules/language/python/module/re/parser.scm +++ b/modules/language/python/module/re/parser.scm @@ -52,17 +52,20 @@ (define flags2 (f-list #:flags2 "(?" (mk-token (f* (f-reg! "[aiLmsux]"))) ")")) - +(define (bch f) (f-or! (f-seq (f-or! (f-tag "\\n") f-nl) + (f-out (list->string (list #\newline)))) + f)) (define bbody (f-cons (f-or! - (f-list #:range (mk-token (f-reg! ".")) - "-" (mk-token (f-reg! "."))) - (f-list #:ch (mk-token (f-reg! ".")))) + (f-list #:range (bch (mk-token (f-reg! "."))) + "-" (bch (mk-token (f-reg! ".")))) + (f-list #:ch (bch (mk-token (f-reg! "."))))) (ff* (f-or! - (f-list #:range (mk-token (f-not! (f-tag "]"))) + (f-list #:range (bch (mk-token (f-not! (f-tag "]")))) "-" - (mk-token (f-not! (f-tag "]")))) - (f-list #:ch (mk-token (f-not! (f-tag "]")))))))) + (bch (mk-token (f-not! (f-tag "]"))))) + (f-seq (f-tag " ") (f-out (list #:ch " "))) + (f-list #:ch (bch (mk-token (f-not! (f-tag "]"))))))))) (define (f-if a b c) (f-or! (f-seq a b) c)) (define choice -- cgit v1.2.3