created racket/syntax from parts of unstable/syntax
original commit: 73ab1675222761363f6633061bc1156189f4ba59
This commit is contained in:
commit
4a36940fd4
|
@ -1,5 +1,6 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require racket/match
|
(require racket/match
|
||||||
|
(for-syntax racket/base)
|
||||||
"../util/eomap.rkt"
|
"../util/eomap.rkt"
|
||||||
"stx-util.rkt"
|
"stx-util.rkt"
|
||||||
"deriv-util.rkt"
|
"deriv-util.rkt"
|
||||||
|
@ -34,9 +35,16 @@
|
||||||
|
|
||||||
;; Syntax
|
;; Syntax
|
||||||
|
|
||||||
(define-syntax-rule (match/count x . clauses)
|
(define-syntax-rule (match/count x clause ...)
|
||||||
(begin (sequence-number (add1 (sequence-number)))
|
(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
|
;; Derivations => Steps
|
||||||
|
|
||||||
|
@ -472,7 +480,10 @@
|
||||||
;; Add remark step?
|
;; Add remark step?
|
||||||
]]
|
]]
|
||||||
[(struct local-remark (contents))
|
[(struct local-remark (contents))
|
||||||
(R [#:reductions (list (walk/talk 'remark contents))])]))
|
(R [#:reductions (list (walk/talk 'remark contents))])]
|
||||||
|
|
||||||
|
[#f
|
||||||
|
(R)]))
|
||||||
|
|
||||||
;; List : ListDerivation -> RST
|
;; List : ListDerivation -> RST
|
||||||
(define (List ld)
|
(define (List ld)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require (for-syntax racket/base
|
(require (for-syntax racket/base
|
||||||
unstable/syntax)
|
racket/syntax)
|
||||||
"yacc-ext.rkt")
|
"yacc-ext.rkt")
|
||||||
(provide ! ? !!
|
(provide ! ? !!
|
||||||
define-production-splitter
|
define-production-splitter
|
||||||
|
|
|
@ -117,8 +117,8 @@
|
||||||
(send -text change-style clickback-style a b)))))
|
(send -text change-style clickback-style a b)))))
|
||||||
|
|
||||||
(define/public (add-syntax stx
|
(define/public (add-syntax stx
|
||||||
#:binders [binders #f]
|
#:binders [binders '#hash()]
|
||||||
#:shift-table [shift-table #f]
|
#:shift-table [shift-table '#hash()]
|
||||||
#:definites [definites #f]
|
#:definites [definites #f]
|
||||||
#:hi-colors [hi-colors null]
|
#:hi-colors [hi-colors null]
|
||||||
#:hi-stxss [hi-stxss null]
|
#:hi-stxss [hi-stxss null]
|
||||||
|
|
|
@ -84,9 +84,9 @@
|
||||||
(show-poststep step shift-table)]))
|
(show-poststep step shift-table)]))
|
||||||
|
|
||||||
(define/public (add-syntax stx
|
(define/public (add-syntax stx
|
||||||
#:binders [binders #f]
|
#:binders [binders '#hash()]
|
||||||
#:definites [definites #f]
|
#:definites [definites #f]
|
||||||
#:shift-table [shift-table #f])
|
#:shift-table [shift-table '#hash()])
|
||||||
(send/i sbview sb:syntax-browser<%> add-syntax stx
|
(send/i sbview sb:syntax-browser<%> add-syntax stx
|
||||||
#:binders binders
|
#:binders binders
|
||||||
#:definites definites
|
#:definites definites
|
||||||
|
|
Loading…
Reference in New Issue
Block a user