fix reified-syntax-class-curry (missing role argument)

This commit is contained in:
Ryan Culpepper 2015-01-29 20:37:50 -05:00
parent b7e86ef6c9
commit 3029867e9f
2 changed files with 12 additions and 2 deletions

View File

@ -30,6 +30,16 @@
#rx"expected natural number greater than 5")
(terx whatever (~reflect x (r-nat> 0) #:attributes (wrong nope)))
(define r-nat>1 (reified-syntax-class-curry r-nat> 1))
(tok (1 2 -3 -4 5) ((~or (~reflect yes (r-nat>1) #:attributes (diff)) no) ...)
(and (s= (yes ...) '(2 5))
(s= (yes.diff ...) '(1 4))
(s= (no ...) '(1 -3 -4))))
(terx 0 (~reflect pos (r-nat>1))
#rx"expected natural number greater than 1")
(terx whatever (~reflect x (r-nat>1) #:attributes (wrong nope)))
(define-splicing-syntax-class opt
(pattern (~seq #:a a:expr)))
(define r-opt (reify-syntax-class opt))

View File

@ -72,9 +72,9 @@
(arity minpos* maxpos* minkws* maxkws*))])]
[curried-parser
(make-keyword-procedure
(lambda (kws2 kwargs2 x cx pr es fh cp success . rest2)
(lambda (kws2 kwargs2 x cx pr es fh cp rl success . rest2)
(let-values ([(kws kwargs) (merge2 kws1 kws2 kwargs1 kwargs2)])
(keyword-apply parser kws kwargs x cx pr es fh cp success
(keyword-apply parser kws kwargs x cx pr es fh cp rl success
(append rest1 rest2)))))]
[ctor
(cond [(reified-syntax-class? r)