diff --git a/collects/redex/private/bitmap-test.ss b/collects/redex/private/bitmap-test.ss index 45de01be54..a92fe265c6 100644 --- a/collects/redex/private/bitmap-test.ss +++ b/collects/redex/private/bitmap-test.ss @@ -111,5 +111,33 @@ (test (render-metafunction multi-arg) "metafunction-multi-arg.png") +;; makes sure that the LHS and RHS of metafunctions are appropriately +;; rewritten + +(define-metafunction lang + subst : e x e -> e + [(subst x x e) e] + [(subst number x e) number] + [(subst x_1 x_2 e) x_1] + [(subst (e_1 e_2) x e) + ((subst e_1 x e) (subst e_2 x e))] + [(subst (λ (x) e_b) x e) + (λ (x) e)] + [(subst (λ (x_f) e_f) x_a e_a) + (λ (x_f) (subst e_f x_a e_a))]) + +(define (subst-rw lws) + (list "" + (list-ref lws 2) + "{" + (list-ref lws 3) + ":=" + (list-ref lws 4) + "}")) + +(test (with-compound-rewriter 'subst subst-rw + (render-metafunction subst)) + "metafunction-subst.png") + (printf "bitmap-test.ss: ") (done) diff --git a/collects/redex/private/bmps/metafunction-subst.png b/collects/redex/private/bmps/metafunction-subst.png new file mode 100644 index 0000000000..5a732a9778 Binary files /dev/null and b/collects/redex/private/bmps/metafunction-subst.png differ diff --git a/collects/redex/private/pict.ss b/collects/redex/private/pict.ss index 84f019b31b..8b59e0803f 100644 --- a/collects/redex/private/pict.ss +++ b/collects/redex/private/pict.ss @@ -748,7 +748,7 @@ ;; the first loc wrapper is just there to make the ;; shape of this line be one that the apply-rewrites ;; function (in core-layout.ss) recognizes as a metafunction - (make-lw "" + (make-lw "(" (lw-line an-lw) 0 (lw-column an-lw)