Macro stepper: moved local-expansion context to bottom

svn: r5667
This commit is contained in:
Ryan Culpepper 2007-02-22 21:49:46 +00:00
parent 3a0a249195
commit 07bea4136c

View File

@ -475,17 +475,15 @@
[(not step) [(not step)
(update:show-final)])))) (update:show-final)]))))
(define/private (update:show-lctx lctx) (define/private (update:show-lctx step)
(define lctx (protostep-lctx step))
(when (pair? lctx) (when (pair? lctx)
(send sbview add-text "\n")
(for-each (lambda (bf) (for-each (lambda (bf)
(send sbview add-text (send sbview add-text
"While executing macro transformer in:\n") "while executing macro transformer in:\n")
(insert-syntax/redex (bigframe-term bf) (bigframe-foci bf))) (insert-syntax/redex (bigframe-term bf) (bigframe-foci bf)))
lctx) (reverse lctx))))
(send sbview add-text "\n")))
(define/private (update:show-protostep step)
(update:show-lctx (protostep-lctx step)))
(define/private (update:separator step) (define/private (update:separator step)
(insert-step-separator (step-type->string (protostep-type step)))) (insert-step-separator (step-type->string (protostep-type step))))
@ -495,25 +493,24 @@
(step-type->string (protostep-type step)))) (step-type->string (protostep-type step))))
(define/private (update:show-step step) (define/private (update:show-step step)
(update:show-protostep step)
(insert-syntax/redex (step-term1 step) (step-foci1 step)) (insert-syntax/redex (step-term1 step) (step-foci1 step))
(update:separator step) (update:separator step)
(insert-syntax/contractum (step-term2 step) (step-foci2 step))) (insert-syntax/contractum (step-term2 step) (step-foci2 step))
(update:show-lctx step))
(define/private (update:show-prestep step) (define/private (update:show-prestep step)
(update:show-protostep step)
(update:separator/small step) (update:separator/small step)
(insert-syntax/redex (prestep-term1 step) (insert-syntax/redex (prestep-term1 step)
(prestep-foci1 step))) (prestep-foci1 step))
(update:show-lctx step))
(define/private (update:show-poststep step) (define/private (update:show-poststep step)
(update:show-protostep step)
(update:separator/small step) (update:separator/small step)
(insert-syntax/contractum (poststep-term2 step) (insert-syntax/contractum (poststep-term2 step)
(poststep-foci2 step))) (poststep-foci2 step))
(update:show-lctx step))
(define/private (update:show-misstep step) (define/private (update:show-misstep step)
(update:show-protostep step)
(insert-syntax/redex (misstep-term1 step) (insert-syntax/redex (misstep-term1 step)
(misstep-foci1 step)) (misstep-foci1 step))
(update:separator step) (update:separator step)
@ -521,7 +518,8 @@
(send sbview add-text "\n") (send sbview add-text "\n")
(when (exn:fail:syntax? (misstep-exn step)) (when (exn:fail:syntax? (misstep-exn step))
(for-each (lambda (e) (send sbview add-syntax e)) (for-each (lambda (e) (send sbview add-syntax e))
(exn:fail:syntax-exprs (misstep-exn step))))) (exn:fail:syntax-exprs (misstep-exn step))))
(update:show-lctx step))
(define/private (update:show-final) (define/private (update:show-final)
(let ([result (lift/deriv-e2 synth-deriv)]) (let ([result (lift/deriv-e2 synth-deriv)])