make sure redex-match? does the duplicate non-terminals check

closes PR 14290
This commit is contained in:
Robby Findler 2014-01-14 16:55:21 -06:00
parent 403a8b42e9
commit cd4de75193
2 changed files with 4 additions and 2 deletions

View File

@ -621,8 +621,7 @@ See match-a-pattern.rkt for more details
;; match-pattern? : compiled-pattern exp -> boolean
(define (match-pattern? compiled-pattern exp)
(let ([results ((compiled-pattern-cp compiled-pattern) exp #f)])
(and results #t)))
(and (match-pattern compiled-pattern exp) #t))
;; match-pattern : compiled-pattern exp -> (union #f (listof bindings))
(define (match-pattern compiled-pattern exp)

View File

@ -280,6 +280,9 @@
(test (map match-bindings (redex-match grammar (a ..._1) (term (a a a))))
'(()))
;; make sure redex-match? does the equality check
(test (redex-match? empty-language (any_0 any_0) (term (1 2))) #f)
(define-syntax (test-match stx)
(syntax-case stx ()
[(_ actual (((var val) ...) ...))