Slightly more error-checking in (message) forms for #:meta-level
This commit is contained in:
parent
c84be7685f
commit
3c3d8f2aaf
|
@ -529,10 +529,14 @@
|
||||||
#,(make-run-script-call outer-expr-stx #'s I-stxs)]))))]
|
#,(make-run-script-call outer-expr-stx #'s I-stxs)]))))]
|
||||||
[_ #f]))))))
|
[_ #f]))))))
|
||||||
|
|
||||||
(define (prepend-at-meta-stx stx level)
|
(define (prepend-at-meta-stx context-stx stx level)
|
||||||
(if (zero? level)
|
(cond
|
||||||
stx
|
[(not (number? level))
|
||||||
#`(at-meta #,(prepend-at-meta-stx stx (- level 1)))))
|
(raise-syntax-error #f "#:meta-level must be a literal constant number" context-stx)]
|
||||||
|
[(zero? level)
|
||||||
|
stx]
|
||||||
|
[else
|
||||||
|
#`(at-meta #,(prepend-at-meta-stx context-stx stx (- level 1)))]))
|
||||||
|
|
||||||
(define (analyze-message-subscription! endpoint-index outer-expr-stx P-stx I-stxs L-stx)
|
(define (analyze-message-subscription! endpoint-index outer-expr-stx P-stx I-stxs L-stx)
|
||||||
(define-values (proj pat match-pat bindings _instantiated)
|
(define-values (proj pat match-pat bindings _instantiated)
|
||||||
|
@ -544,7 +548,7 @@
|
||||||
(match (actor-state-variables s)
|
(match (actor-state-variables s)
|
||||||
[(vector #,@binding-names)
|
[(vector #,@binding-names)
|
||||||
(match #,evt-stx
|
(match #,evt-stx
|
||||||
[(message #,(prepend-at-meta-stx match-pat (syntax-e L-stx)))
|
[(message #,(prepend-at-meta-stx outer-expr-stx match-pat (syntax-e L-stx)))
|
||||||
#,(make-run-script-call outer-expr-stx #'s I-stxs)]
|
#,(make-run-script-call outer-expr-stx #'s I-stxs)]
|
||||||
[_ #f])])))))
|
[_ #f])])))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue