Skip to content

Commit

Permalink
signal a syntax error if mf-apply appears in a pattern position
Browse files Browse the repository at this point in the history
related to #269
  • Loading branch information
rfindler committed Jan 22, 2025
1 parent 14a6ea1 commit b269291
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redex-lib/redex/private/rewrite-side-conditions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ see also term.rkt for some restrictions/changes there
[under-mismatch-ellipsis '()])
(syntax-case term (side-condition variable-except variable-prefix
hole name in-hole hide-hole cross unquote and
compatible-closure-context)
compatible-closure-context #%mf-apply)
[(side-condition pre-pat (and))
;; rewriting metafunctions (and possibly other things) that have no where, etc clauses
;; end up with side-conditions that are empty 'and' expressions, so we just toss them here.
Expand Down Expand Up @@ -391,6 +391,10 @@ see also term.rkt for some restrictions/changes there
(list (make-id/depth term (length under))))]
[else
(values term '())]))]
[(#%mf-apply _ ...)
(raise-syntax-error what "mf-apply cannot be used in a pattern position" orig-stx term)]
[#%mf-apply
(raise-syntax-error what "mf-apply cannot be used in a pattern position" orig-stx term)]
[(terms ...)
(let ()
(define terms-lst (syntax->list #'(terms ...)))
Expand Down

0 comments on commit b269291

Please sign in to comment.