(rx (| numeric alphabetic)) yields a char-set: but
(rx (| ,(rx numeric) ,(rx alphabetic))) doesn't:, even though the "type-checking rules" for char-sets says that it should: > (rx (| numeric alphabetic)) '#{re-char-set} > (rx (| ,(rx numeric) ,(rx alphabetic))) '#{Re-choice} The following patch fixes this but I'm not sure if make-re-choice is the right place to tackle this problem: This fixes bug report #1063781
This commit is contained in:
parent
cfcb6a1b05
commit
f4fbe4c986
|
@ -133,6 +133,8 @@
|
|||
(really-make-re-choice elts tsm (new-cre posix-str tvec)))
|
||||
|
||||
(define (make-re-choice res)
|
||||
(if (every re-char-set? res)
|
||||
(make-re-char-set (apply char-set-union (map re-char-set:cset res)))
|
||||
(make-re-choice/tsm res
|
||||
(fold (lambda (re sm-count)
|
||||
(let ((maybe-tsm (re-tsm re)))
|
||||
|
@ -140,7 +142,7 @@
|
|||
(number? sm-count))
|
||||
(+ maybe-tsm sm-count)
|
||||
(unspecific))))
|
||||
0 res)))
|
||||
0 res))))
|
||||
|
||||
;;; Slightly smart choice constructor:
|
||||
;;; - Flattens nested choices
|
||||
|
|
Loading…
Reference in New Issue