make splicing-tag nonsettable

pull/225/head
Matthew Butterick 4 years ago
parent a4ea21abb5
commit 1f1f7075a2

@ -1,7 +1,7 @@
#lang racket/base
(require (for-syntax
racket/base
"setup.rkt")
"private/splice.rkt")
racket/match
txexpr/base
xml/path
@ -120,7 +120,7 @@
(define-syntax (when/splice stx)
(syntax-case stx ()
[(_ COND . BODY)
(with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))])
(with-syntax ([SPLICING-TAG (datum->syntax stx splice-signal-tag)])
#'(if COND
(SPLICING-TAG . BODY)
(SPLICING-TAG)))]))
@ -130,7 +130,7 @@
(define-syntax (for/splice/base stx)
(syntax-case stx ()
[(_ ITERATORS . BODY)
(with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))]
(with-syntax ([SPLICING-TAG (datum->syntax stx splice-signal-tag)]
[FORM (or (syntax-property stx 'form) #'for/list)])
#'(apply SPLICING-TAG (FORM ITERATORS
(SPLICING-TAG . BODY))))]))

@ -1,7 +1,7 @@
#lang racket/base
(require racket/promise
racket/contract/base
pollen/setup) ; to get splicing char
pollen/private/splice) ; to get splicing char
#|
161017:
This is a slightly amended version of scribble/text/output
@ -129,7 +129,7 @@ This version will also splice lists that begin with the splicing char.
(define npfx (pfx+col (pfx+ pfx lpfx)))
(set-mcar! pfxs npfx) (set-mcdr! pfxs 0)
(if (list? c)
(let ([c (if (eq? (setup:splicing-tag) (car c)) ; patch to cooperate with splicing char
(let ([c (if (eq? splice-signal-tag (car c)) ; patch to cooperate with splicing char
(cdr c)
c)])
(for ([c (in-list c)]) (loop c)))

@ -2,6 +2,7 @@
(require (for-syntax racket/base
syntax/strip-context
"../setup.rkt"
"splice.rkt"
"split-metas.rkt")
racket/list
"to-string.rkt"
@ -23,7 +24,7 @@
(define (stringify xs) (apply string-append (map to-string xs)))
(define (parse xs-in parser-mode root-proc)
(define xs (splice (strip-leading-newlines xs-in) (setup:splicing-tag)))
(define xs (splice (strip-leading-newlines xs-in) splice-signal-tag))
(cond
[(eq? parser-mode default-mode-pagetree) (decode-pagetree xs)]
[(eq? parser-mode default-mode-markup) (apply root-proc (remove-voids xs))]

@ -147,9 +147,6 @@ Both the names and the values of environment variables are case-insensitive, so
@history[#:added "1.1"]}
@defoverridable[splicing-tag symbol?]{Key used to signal that an X-expression should be spliced into its containing X-expression.}
@defoverridable[poly-source-ext symbol?]{Extension that indicates a source file can target multiple output types.}

@ -141,8 +141,6 @@
(define-settable here-path-key 'here-path)
(define+provide splicing-tag '@)
(define-settable poly-source-ext 'poly) ; extension that signals source can be used for multiple output targets
(define-settable poly-targets '(html)) ; current target applied to multi-output source files
(define+provide current-poly-target (make-parameter (car (poly-targets))))

@ -6,7 +6,7 @@
(define paren-match (cadr matches))
paren-match)
(define splicing-tag (setup:splicing-tag))
(define splicing-tag splice-signal-tag)
(define (has-outer-splice-tag? x)
(and (pair? x) (eq? (get-tag x) splicing-tag)))

Loading…
Cancel
Save