From 85c7fb99909c3716cbfd409bda398d56a4f2c15b Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 8 Dec 2013 23:46:01 +0900 Subject: [PATCH] Adding support for (char-set ) pattern. --- lib/chibi/regexp.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/chibi/regexp.scm b/lib/chibi/regexp.scm index 0af03b76..abeecd71 100644 --- a/lib/chibi/regexp.scm +++ b/lib/chibi/regexp.scm @@ -589,6 +589,7 @@ (if (string? (car sre)) (string->char-set (car sre)) (case (car sre) + ((char-set) (string->char-set (cadr sre))) ((/ char-range) (->cs `(or ,@(map (lambda (x) @@ -783,7 +784,7 @@ (state-match-set! n2 (list index num current-match)) (state-match-rule-set! n2 'list) n1))) - ((~ - & / complement difference and char-range) + ((~ - & / complement difference and char-range char-set) (make-char-state (sre->char-set sre flags) ~none next)) ((word) (->rx `(: bow ,@(cdr sre) eow) flags next))