Fixes generation of any' within in-hole' context position

This commit is contained in:
Casey Klein 2011-04-14 14:53:56 -05:00
parent 319ae5f825
commit 46b3a9d13d
2 changed files with 8 additions and 2 deletions

View File

@ -343,7 +343,7 @@
[`any
(λ (r s a e f)
(let*-values ([(lang nt) ((next-any-decision) langc sexpc)]
[(term) (gen-nt lang nt #f r s a (list the-hole))])
[(term) (gen-nt lang nt #f r s a the-not-hole)])
(values term e)))]
[(or (? symbol? (? nt? p)) `(cross ,(? symbol? p)))
(let ([cross? (not (symbol? pat))])

View File

@ -518,7 +518,13 @@
empty any 5 0 (decisions #:nt (patterns first)
#:any (λ (langc sexpc) (values sexpc 'sexp))
#:var (list (λ _ 'x))))
'x))
'x)
(test
(generate-term/decisions
empty (in-hole (any hole) 7) 5 0
(decisions #:any (list (λ (_ sexp) (values sexp 'sexp)))
#:nt (patterns fourth)))
(term (hole 7))))
;; `hide-hole' pattern
(let ()