From 3432cf282f8324fe6b82d6ba1ba240f73c69fe7e Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 11 Aug 2009 22:31:44 +0000 Subject: [PATCH] Adding more specific contracts svn: r15709 --- collects/scribble/private/manual-bib.ss | 7 +++++-- collects/scribble/private/manual-bind.ss | 3 +-- collects/scribble/private/manual-style.ss | 2 +- collects/scribble/private/manual-tech.ss | 3 +-- collects/scribble/private/manual-utils.ss | 6 ++++-- collects/scribblings/scribble/manual.scrbl | 20 ++++++++++---------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/collects/scribble/private/manual-bib.ss b/collects/scribble/private/manual-bib.ss index ee86d2e3b7..4cfe696763 100644 --- a/collects/scribble/private/manual-bib.ss +++ b/collects/scribble/private/manual-bib.ss @@ -10,8 +10,11 @@ (provide/contract [cite ((string?) () #:rest (listof string?) . ->* . element?)] - [bib-entry ((#:key string? #:title any/c) ; XXX should be pre-content or #f - (#:is-book? any/c #:author any/c #:location any/c #:date any/c #:url any/c) + [bib-entry ((#:key string? #:title (or/c false/c pre-content?)) + (#:is-book? boolean? #:author (or/c false/c pre-content?) + #:location (or/c false/c pre-content?) + #:date (or/c false/c pre-content?) + #:url (or/c false/c pre-content?)) . ->* . a-bib-entry?)] [rename a-bib-entry? bib-entry? (any/c . -> . boolean?)] diff --git a/collects/scribble/private/manual-bind.ss b/collects/scribble/private/manual-bind.ss index 5c320a04e2..9df1649488 100644 --- a/collects/scribble/private/manual-bind.ss +++ b/collects/scribble/private/manual-bind.ss @@ -33,8 +33,7 @@ make-binding-redirect-elements sigelem) (provide/contract - ; XXX any/c should be boolean? - [defidentifier ((identifier?) (#:form? any/c #:index? any/c #:show-libs? any/c) . ->* . element?)]) + [defidentifier ((identifier?) (#:form? boolean? #:index? boolean? #:show-libs? boolean?) . ->* . element?)]) (define (gen-absolute-tag) `(abs ,(make-generated-tag))) diff --git a/collects/scribble/private/manual-style.ss b/collects/scribble/private/manual-style.ss index a20869e53b..b8c293394b 100644 --- a/collects/scribble/private/manual-style.ss +++ b/collects/scribble/private/manual-style.ss @@ -34,7 +34,7 @@ [undefined-const element?] [hash-lang (-> element?)] [etc string?] - [inset-flow (() () #:rest (listof any/c) . ->* . any/c)] ; XXX no docs and bad return contract + [inset-flow (() () #:rest (listof pre-content?) . ->* . any/c)] ; XXX no docs and bad return contract [litchar (() () #:rest (listof string?) . ->* . element?)] [t (() () #:rest (listof pre-content?) . ->* . paragraph?)] [commandline (() () #:rest (listof pre-content?) . ->* . paragraph?)] diff --git a/collects/scribble/private/manual-tech.ss b/collects/scribble/private/manual-tech.ss index 799d108be4..539b731325 100644 --- a/collects/scribble/private/manual-tech.ss +++ b/collects/scribble/private/manual-tech.ss @@ -7,8 +7,7 @@ "manual-style.ss") (provide/contract - ; XXX boolean? - [deftech (() (#:style? any/c) #:rest (listof pre-content?) . ->* . element?)] + [deftech (() (#:style? boolean?) #:rest (listof pre-content?) . ->* . element?)] [tech (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)] [techlink (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)]) diff --git a/collects/scribble/private/manual-utils.ss b/collects/scribble/private/manual-utils.ss index 59a2c5d18c..df4650859e 100644 --- a/collects/scribble/private/manual-utils.ss +++ b/collects/scribble/private/manual-utils.ss @@ -2,16 +2,18 @@ (require "../struct.ss" "../decode.ss" "../base.ss" + (only-in "../core.ss" + content?) scheme/contract scheme/list) (provide doc-prefix) (provide/contract [spacer element?] - [to-flow (any/c . -> . flow?)] ; XXX element? + [to-flow (content? . -> . flow?)] [flow-spacer flow?] [flow-empty-line flow?] - [make-table-if-necessary (any/c list? . -> . (list/c (or/c omitable-paragraph? table?)))] ; XXX element? + [make-table-if-necessary (content? list? . -> . (list/c (or/c omitable-paragraph? table?)))] [max-proto-width exact-nonnegative-integer?]) (define spacer (hspace 1)) diff --git a/collects/scribblings/scribble/manual.scrbl b/collects/scribblings/scribble/manual.scrbl index 698adf8811..7a66abbe1a 100644 --- a/collects/scribblings/scribble/manual.scrbl +++ b/collects/scribblings/scribble/manual.scrbl @@ -651,9 +651,9 @@ Like @scheme[schemegrammar], but for typesetting multiple productions at once, aligned around the @litchar{=} and @litchar{|}.} @defproc[(defidentifier [id identifier?] - [#:form? form? any/c #f] - [#:index? index? any/c #t] - [#:show-libs? show-libs? any/c #t]) + [#:form? form? boolean? #f] + [#:index? index? boolean? #t] + [#:show-libs? show-libs? boolean? #t]) element?]{ Typesets @scheme[id] as a Scheme identifier, and also establishes the @@ -906,7 +906,7 @@ An alias of @scheme[hyperlink] for backward compatibility.} An alias of @scheme[other-doc] for backward compatibility.} @defproc[(deftech [pre-content pre-content?] ... - [#:style? style? any/c #t]) element?]{ + [#:style? style? boolean? #t]) element?]{ Produces an element for the @tech{decode}d @scheme[pre-content], and also defines a term that can be referenced elsewhere using @@ -1031,12 +1031,12 @@ which is created with @scheme[bib-entry]. The entries are typeset in order as given.} @defproc[(bib-entry [#:key key string?] - [#:title title any/c] - [#:is-book? is-book? any/c #f] - [#:author author any/c #f] - [#:location location any/c #f] - [#:date date any/c #f] - [#:url url any/c #f]) + [#:title title (or/c false/c pre-content?)] + [#:is-book? is-book? boolean? #f] + [#:author author (or/c false/c pre-content?) #f] + [#:location location (or/c false/c pre-content?) #f] + [#:date date (or/c false/c pre-content?) #f] + [#:url url (or/c false/c pre-content?) #f]) bib-entry?]{ Creates a bibliography entry. The @scheme[key] is used to refer to the