Allow #:define-splicing-syntax-class in define/syntax-parse+simple.
This commit is contained in:
parent
86b76d2fe0
commit
53ae6058ff
|
@ -32,18 +32,21 @@
|
||||||
|
|
||||||
(begin-for-syntax
|
(begin-for-syntax
|
||||||
(define-syntax (define/syntax-parse+simple stx)
|
(define-syntax (define/syntax-parse+simple stx)
|
||||||
(syntax-case stx ()
|
(syntax-parse stx
|
||||||
[(_ [name . args] . body)
|
[(_ (name:name-or-curry . args)
|
||||||
|
(~optional (~seq #:define-splicing-syntax-class define-class-name:id))
|
||||||
|
. body)
|
||||||
(let ()
|
(let ()
|
||||||
(define introducer (make-syntax-introducer))
|
(define introducer (make-syntax-introducer))
|
||||||
(define/with-syntax args-stxclass
|
(define/with-syntax args-stxclass
|
||||||
(introducer (datum->syntax #'args 'args-stxclass) 'add))
|
(or (attribute define-class-name)
|
||||||
|
(introducer (datum->syntax #'args 'args-stxclass) 'add)))
|
||||||
(define/with-syntax body-introduced
|
(define/with-syntax body-introduced
|
||||||
(introducer #'body 'add))
|
(introducer #'body 'add))
|
||||||
#'(begin
|
#'(begin
|
||||||
(define-syntax-class args-stxclass
|
(define-splicing-syntax-class args-stxclass
|
||||||
#:auto-nested-attributes
|
#:auto-nested-attributes
|
||||||
(pattern args))
|
(pattern (~seq . args)))
|
||||||
(define/syntax-parse+simple/stxclass [name args-stxclass]
|
(define/syntax-parse+simple/stxclass [name args-stxclass]
|
||||||
. body-introduced)))]))
|
. body-introduced)))]))
|
||||||
|
|
||||||
|
@ -84,7 +87,7 @@
|
||||||
(define (name stx2)
|
(define (name stx2)
|
||||||
(syntax-parameterize ([stx (make-rename-transformer #'stx2)])
|
(syntax-parameterize ([stx (make-rename-transformer #'stx2)])
|
||||||
(syntax-parse stx2
|
(syntax-parse stx2
|
||||||
[(_ . colon-stxclass) . body])))
|
[(_ colon-stxclass) . body])))
|
||||||
(define def-private-simple-api
|
(define def-private-simple-api
|
||||||
(syntax-parameterize ([stx (make-rename-transformer #'stx/arg)])
|
(syntax-parameterize ([stx (make-rename-transformer #'stx/arg)])
|
||||||
(syntax-parse #'nothing
|
(syntax-parse #'nothing
|
||||||
|
|
Loading…
Reference in New Issue
Block a user