From 1329bb13fbb3b34842c882f32f5aa6134e03623f Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Fri, 4 Feb 2011 15:35:51 -0700 Subject: [PATCH] fixed macro stepper bug Merge to release branch original commit: 2c1d49de6f4b10f8ea921a5c6fc03729c72878d4 --- collects/macro-debugger/model/reductions.rkt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/collects/macro-debugger/model/reductions.rkt b/collects/macro-debugger/model/reductions.rkt index 925d3f2..2eb58fb 100644 --- a/collects/macro-debugger/model/reductions.rkt +++ b/collects/macro-debugger/model/reductions.rkt @@ -1,5 +1,6 @@ #lang racket/base (require racket/match + (for-syntax racket/base) "../util/eomap.rkt" "stx-util.rkt" "deriv-util.rkt" @@ -34,9 +35,16 @@ ;; Syntax -(define-syntax-rule (match/count x . clauses) +(define-syntax-rule (match/count x clause ...) (begin (sequence-number (add1 (sequence-number))) - (match x . clauses))) + (let ([v x]) + (match v + clause ... + [_ (error 'match "failed to match ~e at line ~s" v (line-of x))])))) + +(define-syntax (line-of stx) + (syntax-case stx () + [(line-of x) #`(quote #,(syntax-line #'x))])) ;; Derivations => Steps @@ -472,7 +480,10 @@ ;; Add remark step? ]] [(struct local-remark (contents)) - (R [#:reductions (list (walk/talk 'remark contents))])])) + (R [#:reductions (list (walk/talk 'remark contents))])] + + [#f + (R)])) ;; List : ListDerivation -> RST (define (List ld)