make splicing-tag nonsettable

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

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

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/promise (require racket/promise
racket/contract/base racket/contract/base
pollen/setup) ; to get splicing char pollen/private/splice) ; to get splicing char
#| #|
161017: 161017:
This is a slightly amended version of scribble/text/output 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))) (define npfx (pfx+col (pfx+ pfx lpfx)))
(set-mcar! pfxs npfx) (set-mcdr! pfxs 0) (set-mcar! pfxs npfx) (set-mcdr! pfxs 0)
(if (list? c) (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) (cdr c)
c)]) c)])
(for ([c (in-list c)]) (loop c))) (for ([c (in-list c)]) (loop c)))

@ -2,6 +2,7 @@
(require (for-syntax racket/base (require (for-syntax racket/base
syntax/strip-context syntax/strip-context
"../setup.rkt" "../setup.rkt"
"splice.rkt"
"split-metas.rkt") "split-metas.rkt")
racket/list racket/list
"to-string.rkt" "to-string.rkt"
@ -23,7 +24,7 @@
(define (stringify xs) (apply string-append (map to-string xs))) (define (stringify xs) (apply string-append (map to-string xs)))
(define (parse xs-in parser-mode root-proc) (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 (cond
[(eq? parser-mode default-mode-pagetree) (decode-pagetree xs)] [(eq? parser-mode default-mode-pagetree) (decode-pagetree xs)]
[(eq? parser-mode default-mode-markup) (apply root-proc (remove-voids 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"]} @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.} @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-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-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-settable poly-targets '(html)) ; current target applied to multi-output source files
(define+provide current-poly-target (make-parameter (car (poly-targets)))) (define+provide current-poly-target (make-parameter (car (poly-targets))))

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

Loading…
Cancel
Save