Skip to content

Commit b269291

Browse files
committed
signal a syntax error if mf-apply appears in a pattern position
related to #269
1 parent 14a6ea1 commit b269291

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

redex-lib/redex/private/rewrite-side-conditions.rkt

+5-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ see also term.rkt for some restrictions/changes there
198198
[under-mismatch-ellipsis '()])
199199
(syntax-case term (side-condition variable-except variable-prefix
200200
hole name in-hole hide-hole cross unquote and
201-
compatible-closure-context)
201+
compatible-closure-context #%mf-apply)
202202
[(side-condition pre-pat (and))
203203
;; rewriting metafunctions (and possibly other things) that have no where, etc clauses
204204
;; end up with side-conditions that are empty 'and' expressions, so we just toss them here.
@@ -391,6 +391,10 @@ see also term.rkt for some restrictions/changes there
391391
(list (make-id/depth term (length under))))]
392392
[else
393393
(values term '())]))]
394+
[(#%mf-apply _ ...)
395+
(raise-syntax-error what "mf-apply cannot be used in a pattern position" orig-stx term)]
396+
[#%mf-apply
397+
(raise-syntax-error what "mf-apply cannot be used in a pattern position" orig-stx term)]
394398
[(terms ...)
395399
(let ()
396400
(define terms-lst (syntax->list #'(terms ...)))

0 commit comments

Comments
 (0)