|
|
@ -158,17 +158,19 @@ This would be the place to check a syntax property for hiding.
|
|
|
|
(datum->syntax #f d (positions->srcloc start-pos end-pos) stx-with-original?-property))
|
|
|
|
(datum->syntax #f d (positions->srcloc start-pos end-pos) stx-with-original?-property))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define splice-signal '@)
|
|
|
|
|
|
|
|
;; rule-components->syntax: (U symbol false) (listof stx) ... #:srcloc (U #f (list src line column offset span)) -> stx
|
|
|
|
;; rule-components->syntax: (U symbol false) (listof stx) ... #:srcloc (U #f (list src line column offset span)) -> stx
|
|
|
|
;; Creates an stx out of the rule name and its components.
|
|
|
|
;; Creates an stx out of the rule name and its components.
|
|
|
|
;; The location information of the rule spans that of its components.
|
|
|
|
;; The location information of the rule spans that of its components.
|
|
|
|
(define (rule-components->syntax rule-name/false #:srcloc [srcloc #f] #:splice? [splice #f] . componentss)
|
|
|
|
(define (rule-components->syntax rule-name/false #:srcloc [srcloc #f] #:hide-or-splice? [hide-or-splice #f] . componentss)
|
|
|
|
(let ([spliced-componentss (append-map (λ(cs)
|
|
|
|
(let ([spliced-componentss (append-map (λ(cs)
|
|
|
|
(if (and (pair? cs) (syntax-property (car cs) 'splice))
|
|
|
|
(cond
|
|
|
|
(list (list (syntax-case (car cs) ()
|
|
|
|
[(and (pair? cs) (equal? (syntax-property (car cs) 'hide-or-splice) "hide"))
|
|
|
|
[(rule-name c ...)
|
|
|
|
(list (list (syntax-case (car cs) ()
|
|
|
|
#'(c ...)])))
|
|
|
|
[(rule-name c ...)
|
|
|
|
(list cs))) componentss)])
|
|
|
|
#'(c ...)])))]
|
|
|
|
|
|
|
|
[(and (pair? cs) (equal? (syntax-property (car cs) 'hide-or-splice) "splice"))
|
|
|
|
|
|
|
|
(list (cdr (syntax->list (car cs))))]
|
|
|
|
|
|
|
|
[else (list cs)])) componentss)])
|
|
|
|
(syntax-property
|
|
|
|
(syntax-property
|
|
|
|
(datum->syntax #f
|
|
|
|
(datum->syntax #f
|
|
|
|
(cons
|
|
|
|
(cons
|
|
|
@ -176,4 +178,4 @@ This would be the place to check a syntax property for hiding.
|
|
|
|
(apply append spliced-componentss))
|
|
|
|
(apply append spliced-componentss))
|
|
|
|
srcloc
|
|
|
|
srcloc
|
|
|
|
stx-with-original?-property)
|
|
|
|
stx-with-original?-property)
|
|
|
|
'splice splice)))
|
|
|
|
'hide-or-splice hide-or-splice)))
|