www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4a36940fd45cd134f6d59d2ab0dde87fe8910f80
parent d09828a0195896bf808446c6bda71c5800d43b41
Author: Ryan Culpepper <ryanc@racket-lang.org>
Date:   Thu,  7 Apr 2011 06:35:03 -0600

created racket/syntax from parts of unstable/syntax

original commit: 73ab1675222761363f6633061bc1156189f4ba59

Diffstat:
Mcollects/macro-debugger/model/reductions.rkt | 17++++++++++++++---
Mcollects/macro-debugger/model/yacc-interrupted.rkt | 2+-
Mcollects/macro-debugger/syntax-browser/widget.rkt | 4++--
Mcollects/macro-debugger/view/step-display.rkt | 4++--
4 files changed, 19 insertions(+), 8 deletions(-)

diff --git 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) diff --git a/collects/macro-debugger/model/yacc-interrupted.rkt b/collects/macro-debugger/model/yacc-interrupted.rkt @@ -1,6 +1,6 @@ #lang racket/base (require (for-syntax racket/base - unstable/syntax) + racket/syntax) "yacc-ext.rkt") (provide ! ? !! define-production-splitter diff --git 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 @@ -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