summaryrefslogtreecommitdiff
path: root/modules/language/python/module/re/parser.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-08-12 21:52:45 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-08-12 21:52:45 +0200
commitfa1af3858f999783b26269ec159fca3d1b8291fd (patch)
tree1beca8f0a84edeaed6b25337cd86cbc99a83d969 /modules/language/python/module/re/parser.scm
parent85d5763490601299daa660bef455b0eaae8b2560 (diff)
textwrap compiles
Diffstat (limited to 'modules/language/python/module/re/parser.scm')
-rw-r--r--modules/language/python/module/re/parser.scm17
1 files changed, 10 insertions, 7 deletions
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