test-copy-attribute-template-problem.rkt (523B)
1 #lang racket 2 (require subtemplate/private/copy-attribute 3 stxparse-info/parse 4 stxparse-info/parse/experimental/template 5 phc-toolkit/untyped 6 rackunit) 7 8 (check-not-exn 9 (λ () 10 (syntax-parse #'([1 2 3] #:kw [4 5]) 11 [({~and {~or #:kw (x …)}} …) 12 ;; The syntax? argument must be #f, not #t, when there are some optional 13 ;; elements, otherwise an exception is raised. 14 (copy-raw-syntax-attribute y (attribute* x) 2 #f) 15 (template [(?? (?@ y …) empty) …])])))