From b3f7015cbac489a04658e0202b1026d5d790f2e9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 7 Oct 2020 07:35:53 -0600 Subject: [PATCH] allow content (not just a string) for #:kind in `defthing`, etc. Although commit 5415cca336 just made run-time checking consistent with the documentation, the implementation turned out to allow content before, and some existing documents relied on that. Changes the documentation and contract to allow content, instead. --- scribble-doc/scribblings/scribble/manual.scrbl | 14 +++++++------- scribble-lib/scribble/private/manual-proc.rkt | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scribble-doc/scribblings/scribble/manual.scrbl b/scribble-doc/scribblings/scribble/manual.scrbl index 7c029a7c..d303c5f8 100644 --- a/scribble-doc/scribblings/scribble/manual.scrbl +++ b/scribble-doc/scribblings/scribble/manual.scrbl @@ -836,7 +836,7 @@ Equivalent to @racket[defmodule] variants @racket[#:no-declare].} ellipses+] [options (code:line maybe-kind maybe-link maybe-id)] [maybe-kind code:blank - (code:line #:kind kind-string-expr)] + (code:line #:kind kind-content-expr)] [maybe-link code:blank (code:line #:link-target? link-target?-expr)] [maybe-id code:blank @@ -945,8 +945,8 @@ by the @racket[current-display-width] parameter. An optional @racket[#:kind] specification chooses the decorative label, which defaults to @racket["procedure"]. A @racket[#f] -result for @racket[kind-string-expr] uses the default, otherwise -@racket[kind-string-expr] should produce a string. An alternate +result for @racket[kind-content-expr] uses the default, otherwise +@racket[kind-content-expr] should produce content in the sense of @racket[content?]. An alternate label should be all lowercase. If @racket[#:id [src-id dest-id-expr]] is supplied, then @@ -1007,7 +1007,7 @@ Examples: pre-flow ...) ([options (code:line maybe-kind maybe-link maybe-id maybe-literals)] [maybe-kind code:blank - (code:line #:kind kind-string-expr)] + (code:line #:kind kind-content-expr)] [maybe-link code:blank (code:line #:link-target? link-target?-expr)] [maybe-id code:blank @@ -1028,7 +1028,7 @@ result of @racket[id-expr]) whose syntax is described by @racket[id], then @racket[form-datum] must have the form @racket[(id . _datum)]. -If @racket[#:kind kind-string-expr] is supplied, it is used in the +If @racket[#:kind kind-content-expr] is supplied, it is used in the same way as for @racket[defproc], but the default kind is @racket["syntax"]. @@ -1338,7 +1338,7 @@ Like @racket[defparam], but the contract on a parameter argument is pre-flow ...) ([options (code:line maybe-kind maybe-link maybe-id)] [maybe-kind code:blank - (code:line #:kind kind-string-expr)] + (code:line #:kind kind-content-expr)] [maybe-link code:blank (code:line #:link-target? link-target?-expr)] [maybe-id code:blank @@ -1348,7 +1348,7 @@ Like @racket[defparam], but the contract on a parameter argument is Like @racket[defproc], but for a non-procedure binding. -If @racket[#:kind kind-string-expr] is supplied, +If @racket[#:kind kind-content-expr] is supplied, it is used in the same way as for @racket[defproc], but the default kind is @racket["value"]. diff --git a/scribble-lib/scribble/private/manual-proc.rkt b/scribble-lib/scribble/private/manual-proc.rkt index 140b0d0d..a5de2a45 100644 --- a/scribble-lib/scribble/private/manual-proc.rkt +++ b/scribble-lib/scribble/private/manual-proc.rkt @@ -4,7 +4,9 @@ "../basic.rkt" "../manual-struct.rkt" (only-in "../core.rkt" - make-style make-table-columns) + make-style + make-table-columns + content?) "../html-properties.rkt" "qsloc.rkt" "manual-utils.rkt" @@ -131,7 +133,7 @@ #:attributes (kind) ;; Expr[String/#f] #:description "#:kind keyword" (pattern (~optional (~seq #:kind k)) - #:declare k (expr/c #'(or/c string? #f) #:name "#:kind argument") + #:declare k (expr/c #'(or/c content? #f) #:name "#:kind argument") #:with kind #'(~? k.c #f))) (define-splicing-syntax-class value-kw