Adding support for (char-set <string>) pattern.

This commit is contained in:
Alex Shinn 2013-12-08 23:46:01 +09:00
parent 4012cbdb36
commit 85c7fb9990

View file

@ -589,6 +589,7 @@
(if (string? (car sre)) (if (string? (car sre))
(string->char-set (car sre)) (string->char-set (car sre))
(case (car sre) (case (car sre)
((char-set) (string->char-set (cadr sre)))
((/ char-range) ((/ char-range)
(->cs (->cs
`(or ,@(map (lambda (x) `(or ,@(map (lambda (x)
@ -783,7 +784,7 @@
(state-match-set! n2 (list index num current-match)) (state-match-set! n2 (list index num current-match))
(state-match-rule-set! n2 'list) (state-match-rule-set! n2 'list)
n1))) n1)))
((~ - & / complement difference and char-range) ((~ - & / complement difference and char-range char-set)
(make-char-state (sre->char-set sre flags) ~none next)) (make-char-state (sre->char-set sre flags) ~none next))
((word) ((word)
(->rx `(: bow ,@(cdr sre) eow) flags next)) (->rx `(: bow ,@(cdr sre) eow) flags next))