From 139cc91b33fe111025d28e3a77b90b3f23046691 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Thu, 3 Feb 2011 14:32:34 -0700 Subject: [PATCH 1/2] fix macro stepper bug (missing hash) Merge to release branch original commit: 1054c504ead66fc348487ec726c92bb83a51bd67 --- collects/macro-debugger/syntax-browser/widget.rkt | 4 ++-- collects/macro-debugger/view/step-display.rkt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/collects/macro-debugger/syntax-browser/widget.rkt b/collects/macro-debugger/syntax-browser/widget.rkt index fd75cdd..b84fddc 100644 --- a/collects/macro-debugger/syntax-browser/widget.rkt +++ b/collects/macro-debugger/syntax-browser/widget.rkt @@ -117,8 +117,8 @@ (send -text change-style clickback-style a b))))) (define/public (add-syntax stx - #:binders [binders #f] - #:shift-table [shift-table #f] + #:binders [binders '#hash()] + #:shift-table [shift-table '#hash()] #:definites [definites #f] #:hi-colors [hi-colors null] #:hi-stxss [hi-stxss null] diff --git a/collects/macro-debugger/view/step-display.rkt b/collects/macro-debugger/view/step-display.rkt index 51259a6..d2f6f7d 100644 --- a/collects/macro-debugger/view/step-display.rkt +++ b/collects/macro-debugger/view/step-display.rkt @@ -84,9 +84,9 @@ (show-poststep step shift-table)])) (define/public (add-syntax stx - #:binders [binders #f] + #:binders [binders '#hash()] #:definites [definites #f] - #:shift-table [shift-table #f]) + #:shift-table [shift-table '#hash()]) (send/i sbview sb:syntax-browser<%> add-syntax stx #:binders binders #:definites definites From 1329bb13fbb3b34842c882f32f5aa6134e03623f Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Fri, 4 Feb 2011 15:35:51 -0700 Subject: [PATCH 2/2] 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)