[regexp] fail on starred groups
This commit is contained in:
parent
5bd4c6d957
commit
8687fb3481
|
@ -62,6 +62,10 @@
|
|||
(loop (+ i 1) (cons i in-paren) num-groups))]
|
||||
[(#\))
|
||||
(cond
|
||||
[(and (< i last-index)
|
||||
(eq? #\* (string-ref str (+ i 1))))
|
||||
;; Group is starred, can't predict num. matches statically
|
||||
#f]
|
||||
[(null? in-paren)
|
||||
(group-error str (format "')' at index ~a" i))]
|
||||
[(eq? #f (car in-paren))
|
||||
|
|
|
@ -42,4 +42,7 @@
|
|||
;; --- Can't handle |, yet
|
||||
(ann (regexp-match: "this(group)|that" "that")
|
||||
(U #f (List String String)))
|
||||
;; --- can't handle starred groups
|
||||
(ann (regexp-match: "(a)*(b)" "b")
|
||||
(U #f (List String String)))
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue
Block a user