Fix for (rx (|)) by Peter Wang

This commit is contained in:
mainzelm 2003-10-23 15:55:55 +00:00
parent e60e77997f
commit acb0c8265f
2 changed files with 10 additions and 6 deletions

View File

@ -437,11 +437,15 @@
re-choice:posix))
((re-char-set? re)
(if (re-any? re)
(r 're-any) ; Special hack for ANY.
(doit/leaf 'make-re-char-set 'make-re-char-set/posix
`(,(char-set->scheme (re-char-set:cset re) r))
re-char-set:posix)))
(cond
((re-any? re)
(r 're-any)) ; Special hack for ANY.
((re-empty? re)
(r 're-empty)) ; Special hack for EMPTY.
(else
(doit/leaf 'make-re-char-set 'make-re-char-set/posix
`(,(char-set->scheme (re-char-set:cset re) r))
re-char-set:posix))))
((re-repeat? re)
(doit 'make-re-repeat 'make-re-repeat/tsm (re-repeat:tsm re)

View File

@ -93,7 +93,7 @@
(define (regexp->posix-string re)
;; We *must* simplify, to guarantee correct translation.
(let ((re (simplify-regexp re)))
(if (simple-empty-re? re) (values #f #f #f #f)
(if (simple-empty-re? re) (values #f #f #f '#())
(translate-regexp re))))