Fix character sets containing both ] and -.
This commit is contained in:
parent
edae15ae5b
commit
803b2b1034
|
@ -615,12 +615,12 @@
|
|||
(receive (new-loose new-ranges) (shrink-range-start (car ranges))
|
||||
(lp (append new-loose loose) (append new-ranges ranges) end-hyphen?)))
|
||||
|
||||
;; If both [ and - are in the loose char set,
|
||||
;; If both ] and - are in the loose char set,
|
||||
;; pull - out as special end-hypen.
|
||||
((and (pair? loose)
|
||||
(pair? (cdr loose))
|
||||
(char=? (car loose) #\[)
|
||||
(char=? (car loose) #\-))
|
||||
(char=? (car loose) #\])
|
||||
(char=? (cadr loose) #\-))
|
||||
(lp (cons (car loose) (cddr loose)) ranges #t))
|
||||
|
||||
;; No change! Build the answer...
|
||||
|
@ -629,4 +629,5 @@
|
|||
(apply string-append
|
||||
(map (lambda (r) (string (car r) #\- (cdr r)))
|
||||
ranges))
|
||||
(if end-hyphen? "-" "")
|
||||
"]"))))))))
|
||||
|
|
Loading…
Reference in New Issue