Fixes bug demonstrated by previous commit.

Now (repetition 1 1 e) is a charset if e is a charset, but other number
of repetitions are not.
pull/6/head
Jesse A. Tov 5 years ago committed by Matthew Butterick
parent 0eecc81e6c
commit f8c3f37646

@ -134,7 +134,7 @@
[(list? s-re) (case (car s-re) [(list? s-re) (case (car s-re)
[(union intersection) (andmap char-set? (cdr s-re))] [(union intersection) (andmap char-set? (cdr s-re))]
[(char-range char-complement) #t] [(char-range char-complement) #t]
[(repetition) (and (= (cadr s-re) (caddr s-re)) (char-set? (cadddr s-re)))] [(repetition) (and (= 1 (cadr s-re) (caddr s-re)) (char-set? (cadddr s-re)))]
[(concatenation) (and (= 2 (length s-re)) (char-set? (cadr s-re)))] [(concatenation) (and (= 2 (length s-re)) (char-set? (cadr s-re)))]
(else #f))] (else #f))]
[else #f])) [else #f]))

Loading…
Cancel
Save