Fixes a bug with `where' clauses
This commit is contained in:
parent
8eb25bb2b9
commit
72b98b77fb
|
@ -266,7 +266,9 @@
|
|||
#,
|
||||
(case where-mode
|
||||
[(flatten)
|
||||
#`(apply append (map result mtchs))]
|
||||
#`(for/fold ([r '()]) ([m mtchs])
|
||||
(let ([s (result m)])
|
||||
(if s (append s r) r)))]
|
||||
[(predicate)
|
||||
#`(ormap result mtchs)]
|
||||
[else (error 'unknown-where-mode "~s" where-mode)])
|
||||
|
|
|
@ -886,6 +886,18 @@
|
|||
'(x 4)))
|
||||
'(x))
|
||||
|
||||
; test multiply matching `where' with failing `where' inside
|
||||
(test (apply-reduction-relation
|
||||
(reduction-relation
|
||||
empty-language
|
||||
(--> ()
|
||||
()
|
||||
(where (number_1 ... number_i number_i+1 ...)
|
||||
(1 2 3))
|
||||
(where number_i 2)))
|
||||
'())
|
||||
'(()))
|
||||
|
||||
(test (apply-reduction-relation/tag-with-names
|
||||
(reduction-relation
|
||||
grammar
|
||||
|
@ -1703,7 +1715,7 @@
|
|||
(where (y ... w z ...) (x ...)))))
|
||||
|
||||
(test (apply-reduction-relation red (term (a b c)))
|
||||
(list (term (a b)) (term (a c)) (term (b c)))))
|
||||
(list (term (b c)) (term (a c)) (term (a b)))))
|
||||
|
||||
|
||||
(let ([r (reduction-relation
|
||||
|
|
Loading…
Reference in New Issue
Block a user