From f832efe568e1235752f0709968fada5213bd687c Mon Sep 17 00:00:00 2001 From: Stefan Israelsson Tampe Date: Sat, 14 Jul 2018 12:18:12 +0200 Subject: dotall --- modules/language/python/module/re/compile.scm | 37 +++++++++++++++++++-------- modules/language/python/module/re/flags.scm | 6 ++++- modules/language/python/module/re/parser.scm | 2 +- 3 files changed, 32 insertions(+), 13 deletions(-) (limited to 'modules/language/python/module/re') diff --git a/modules/language/python/module/re/compile.scm b/modules/language/python/module/re/compile.scm index ca7663d..210a2ad 100644 --- a/modules/language/python/module/re/compile.scm +++ b/modules/language/python/module/re/compile.scm @@ -6,7 +6,7 @@ #:use-module ((parser stis-parser) #:select ((parse . stisparse) .. f-nl! f-nl f-tag! f-tag f-seq f-or f-or! f-and f-true g* g+ gmn ng* ng+ - ngmn f-reg! f-and! f-test N M X XL + ngmn f-reg! f-and! f-test N M X XL f-pk g? ng? f-test! f-eof f-not! f-prev f-not f-out f-rev *whitespace* f-nm f-pos)) @@ -33,6 +33,18 @@ (when (= N 0) ( (wrap L c))))) +(define dotall + ( (L c) + (let ((x (fluid-ref *flags*))) + (when (pk (not (= 0 (logand x DOTALL)))) + ( (wrap L c)))))) + +(define multiline + ( (L c) + (let ((x (fluid-ref *flags*))) + (when (not (= 0 (logand x DOTALL))) + ( (wrap L c)))))) + (define (gt f) ( (L c) (let ((x #f)) @@ -149,8 +161,9 @@ ((#:?<= f) f) ((#:?