Fix Redex variable-not-otherwise-mentioned bug.

And add a test to keep it from happening again.
This commit is contained in:
Max New 2013-09-06 09:36:18 -07:00
parent 2873ba700f
commit e02d425aa5
2 changed files with 4 additions and 2 deletions

View File

@ -242,7 +242,9 @@
[else (loop sub-pat)])) [else (loop sub-pat)]))
sub-pats)] sub-pats)]
[(? (compose not pair?)) [(? (compose not pair?))
(set pat)]))) (if (symbol? pat)
(set pat)
(set))])))
(nt-rhs the-nt))) (nt-rhs the-nt)))
lang))) lang)))

View File

@ -80,7 +80,7 @@
;; test variable-not-otherwise-mentioned ;; test variable-not-otherwise-mentioned
(define-language VarMentioned (define-language VarMentioned
(mention a b c x y z) (mention a b c x y z 2 #f #\c (vec 1 2))
(var variable-not-otherwise-mentioned)) (var variable-not-otherwise-mentioned))
(try-it 20 VarMentioned var) (try-it 20 VarMentioned var)