Added mutable-match-element-id-transformer
This commit is contained in:
parent
49de4c776a
commit
a5119a7b15
8
main.rkt
8
main.rkt
|
@ -1,4 +1,4 @@
|
|||
#lang racket/base
|
||||
|
||||
(require scribble-enhanced/manual-form)
|
||||
(provide (all-from-out scribble-enhanced/manual-form))
|
||||
#lang reprovide
|
||||
scribble-enhanced/manual-form
|
||||
scribble-enhanced/manual-scheme
|
||||
scribble-enhanced/racket
|
|
@ -12,7 +12,7 @@
|
|||
scribble/private/qsloc
|
||||
scribble/private/manual-utils
|
||||
scribble/private/manual-vars
|
||||
scribble/private/manual-scheme
|
||||
"manual-scheme.rkt"
|
||||
scribble/private/manual-bind
|
||||
scheme/list
|
||||
syntax/parse/define
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#lang racket/base
|
||||
(require "../decode.rkt"
|
||||
"../struct.rkt"
|
||||
"../scheme.rkt"
|
||||
"../search.rkt"
|
||||
"../basic.rkt"
|
||||
(only-in "../core.rkt" style style-properties)
|
||||
"manual-style.rkt"
|
||||
"manual-utils.rkt" ;; used via datum->syntax
|
||||
"on-demand.rkt"
|
||||
(require scribble/decode
|
||||
scribble/struct
|
||||
"racket.rkt";; was: "../scheme.rkt"
|
||||
scribble/search
|
||||
scribble/basic
|
||||
(only-in scribble/core style style-properties)
|
||||
scribble/private/manual-style
|
||||
scribble/private/manual-utils ;; used via datum->syntax
|
||||
scribble/private/on-demand
|
||||
(for-syntax racket/base)
|
||||
(for-label racket/base))
|
||||
|
||||
|
|
34
racket.rkt
34
racket.rkt
|
@ -1,10 +1,10 @@
|
|||
(module racket racket/base
|
||||
(require "core.rkt"
|
||||
"basic.rkt"
|
||||
"search.rkt"
|
||||
"private/manual-sprop.rkt"
|
||||
"private/on-demand.rkt"
|
||||
"html-properties.rkt"
|
||||
#lang racket/base
|
||||
(require scribble/core
|
||||
scribble/basic
|
||||
scribble/search
|
||||
scribble/private/manual-sprop
|
||||
scribble/private/on-demand
|
||||
scribble/html-properties
|
||||
file/convertible
|
||||
racket/extflonum
|
||||
(for-syntax racket/base))
|
||||
|
@ -972,6 +972,21 @@
|
|||
" bound as an code-typesetting element transformer")
|
||||
stx))))
|
||||
|
||||
(begin-for-syntax
|
||||
(require mutable-match-lambda)
|
||||
|
||||
(define mutable-match-element-id-transformer
|
||||
(make-mutable-match-lambda/infer-name))
|
||||
|
||||
(define (try-mutable-match-element-id-transformer . vs)
|
||||
(apply (apply make-mutable-match-lambda
|
||||
(append (mutable-match-lambda-procedure-procs
|
||||
mutable-match-element-id-transformer)
|
||||
(list (clause->proc #:match-lambda [_ #f]))))
|
||||
vs))
|
||||
|
||||
(provide mutable-match-element-id-transformer))
|
||||
|
||||
(define-syntax (define-code stx)
|
||||
(syntax-case stx ()
|
||||
[(_ code typeset-code uncode d->s stx-prop)
|
||||
|
@ -994,6 +1009,9 @@
|
|||
(wrap-loc v #f `(,#'make-var-id ',(variable-id-sym slv)))]
|
||||
[(element-id-transformer? slv)
|
||||
(wrap-loc v #f ((element-id-transformer-proc slv) v))]
|
||||
[(try-mutable-match-element-id-transformer v)
|
||||
=> (λ (transformed)
|
||||
(wrap-loc v #f transformed))]
|
||||
[(syntax? v)
|
||||
(let ([mk (wrap-loc
|
||||
v
|
||||
|
@ -1379,4 +1397,4 @@
|
|||
(max 1 (- (syntax-position pairs) undelta))
|
||||
(+ (syntax-span pairs) undelta))))]
|
||||
[else
|
||||
(datum->syntax #f v (vector #f line col (+ 1 col) 1))])))
|
||||
(datum->syntax #f v (vector #f line col (+ 1 col) 1))]))
|
Loading…
Reference in New Issue
Block a user