redex-match violates its documented contract
This patch fixes the problem that the hole matcher may return an empty list rather than a #f that gets sent to the caller of redex-match. I re-ran the Redex tests and found no violations. However, I am not confident that there isn't a more correct place to put this '() -> #f replacement. I will be immediately forwarding this push email to Robby to have him check it.
This commit is contained in:
parent
523ccff762
commit
99f1cc44df
|
@ -1324,7 +1324,10 @@ See match-a-pattern.rkt for more details
|
|||
(let loop ([mtches mtches]
|
||||
[acc null])
|
||||
(cond
|
||||
[(null? mtches) acc]
|
||||
[(null? mtches)
|
||||
(if (null? acc)
|
||||
#f
|
||||
acc)]
|
||||
[else
|
||||
(let* ([mtch (car mtches)]
|
||||
[bindings (mtch-bindings mtch)]
|
||||
|
|
|
@ -424,6 +424,10 @@
|
|||
(test (and (redex-match L -b 100) #t) #t)
|
||||
(test (redex-match L -b 3) #f))
|
||||
|
||||
(let ()
|
||||
(test (redex-match empty-language number 'a) #f)
|
||||
(test (redex-match empty-language (in-hole hole number) 'a) #f))
|
||||
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
(eval '(require redex/reduction-semantics redex/pict))
|
||||
(eval '(define-language L
|
||||
|
|
Loading…
Reference in New Issue
Block a user