From f37c71c6ee298290acb93319e21ba5048fac3a27 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 13 Aug 2009 16:24:33 +0000 Subject: [PATCH] setup-plt -D skips compilation of .scrbl files svn: r15727 --- collects/compiler/compiler-unit.ss | 22 ++++++++++++++----- collects/scribblings/mzc/api.scrbl | 24 +++++++++++++++------ collects/scribblings/reference/struct.scrbl | 11 ++++++---- collects/scriblib/autobib.ss | 2 +- collects/setup/setup-unit.ss | 2 +- 5 files changed, 43 insertions(+), 18 deletions(-) diff --git a/collects/compiler/compiler-unit.ss b/collects/compiler/compiler-unit.ss index 6037b8cd71..c66c883906 100644 --- a/collects/compiler/compiler-unit.ss +++ b/collects/compiler/compiler-unit.ss @@ -144,7 +144,10 @@ (let ([zo (append-zo-suffix b)]) (compile-to-zo f zo n prefix verbose? mod?))))) - (define (compile-directory dir info #:verbose [verbose? #t] #:skip-path [orig-skip-path #f]) + (define (compile-directory dir info + #:verbose [verbose? #t] + #:skip-path [orig-skip-path #f] + #:skip-doc-sources? [skip-docs? #f]) (define info* (or info (lambda (key mk-default) (mk-default)))) (define omit-paths (omitted-paths dir c-get-info/full)) (define skip-path (and orig-skip-path (path->bytes @@ -173,7 +176,9 @@ ;; Find all .ss/.scm files: (filter extract-base-filename/ss (directory-list)) ;; Add specified doc sources: - (map car (info* 'scribblings (lambda () null))))] + (if skip-docs? + null + (map car (info* 'scribblings (lambda () null)))))] [sses (remove* omit-paths sses)]) (for-each (make-caching-managed-compile-zo) sses))) (when (compile-subcollections) @@ -183,13 +188,20 @@ (for ([p (directory-list dir)]) (let ([p* (build-path dir p)]) (when (and (directory-exists? p*) (not (member p omit-paths))) - (compile-directory p* (c-get-info/full p*)))))))) + (compile-directory p* (c-get-info/full p*) + #:verbose verbose? + #:skip-path skip-path + #:skip-doc-sources? skip-docs?))))))) - (define (compile-collection-zos collection #:skip-path [skip-path #f] . cp) + (define (compile-collection-zos collection + #:skip-path [skip-path #f] + #:skip-doc-sources? [skip-docs? #f] + . cp) (compile-directory (apply collection-path collection cp) (c-get-info (cons collection cp)) #:verbose #f - #:skip-path skip-path)) + #:skip-path skip-path + #:skip-doc-sources? skip-docs?)) (define compile-directory-zos compile-directory) diff --git a/collects/scribblings/mzc/api.scrbl b/collects/scribblings/mzc/api.scrbl index 7048bf2c4e..601a4dc2da 100644 --- a/collects/scribblings/mzc/api.scrbl +++ b/collects/scribblings/mzc/api.scrbl @@ -65,14 +65,20 @@ If @scheme[verbose?] is @scheme[#t], the output file for each given file is reported through the current output port.} -@defproc[(compile-collection-zos [collection string?] ...+) +@defproc[(compile-collection-zos [collection string?] ...+ + [#:skip-path skip-path (or/c path-string? #f) #f] + [#:skip-doc-sources? skip-docs? any/c #f]) void?]{ Compiles the specified collection's files to @filepath{.zo} files. The @filepath{.zo} files are placed into the collection's @filepath{compiled} directory. By default, all files with the extension @filepath{.ss} or @filepath{.scm} in a collection are -compiled, as are all such files within subdirectories. +compiled, as are all such files within subdirectories, execept that +any file or directory whose path starts with @scheme[scheme-path] is +skipped. (``Starts with'' means that the simplified path @scheme[_p]'s +byte-string form after @scheme[(simplify-path _p #f)]starts with the +byte-string form of @scheme[(simplify-path skip-path #f)].) The collection compiler reads the collection's @filepath{info.ss} file (see @secref[#:doc '(lib "scribblings/setup-plt/setup-plt.scrbl") @@ -103,10 +109,11 @@ collection. The following fields are used: contents of @scheme[compile-omit-paths]. Do not use this field; it is for backward compatibility.} - @item{@indexed-scheme[scribblings] : A list of pairs, each of which starts - with a path for documentation source. The sources (and the - files that they require) are compiled in the same way as - @filepath{.ss} and @filepath{.scm} files.} + @item{@indexed-scheme[scribblings] : A list of pairs, each of which + starts with a path for documentation source. The sources (and + the files that they require) are compiled in the same way as + @filepath{.ss} and @filepath{.scm} files, unless the provided + @scheme[skip-docs?] argument is a true value.} ] @@ -115,7 +122,10 @@ The compilation process for an individual file is driven by @defproc[(compile-directory-zos [path path-string?] - [info ()]) + [info ()] + [#:verbose verbose? any/c #f] + [#:skip-path skip-path (or/c path-string? #f) #f] + [#:skip-doc-sources? skip-docs? any/c #f]) void?]{ Like @scheme[compile-collection-zos], but compiles the given directory diff --git a/collects/scribblings/reference/struct.scrbl b/collects/scribblings/reference/struct.scrbl index b4bb35bf2e..8f462b7ea9 100644 --- a/collects/scribblings/reference/struct.scrbl +++ b/collects/scribblings/reference/struct.scrbl @@ -66,11 +66,14 @@ field), and field mutability. @index['("structures" "equality")]{Two} structure values are @scheme[eqv?] if and only if they are @scheme[eq?]. Two structure -values are @scheme[equal?] if they are @scheme[eq?], or if they are -instances of the same structure type, no fields are opaque, and the -results of applying @scheme[struct->vector] to the structs are +values are @scheme[equal?] if they are @scheme[eq?]. By default, two +structure values are also @scheme[equal?] if they are instances of the +same structure type, no fields are opaque, and the results of applying +@scheme[struct->vector] to the structs are @scheme[equal?]. (Consequently, @scheme[equal?] testing for -structures depends on the current inspector.) +structures may depend on the current inspector.) A structure type can +override the default @scheme[equal?] definition through the +@scheme[prop:equal+hash] property. @local-table-of-contents[] diff --git a/collects/scriblib/autobib.ss b/collects/scriblib/autobib.ss index 3da8ba8150..9c8de65ab8 100644 --- a/collects/scriblib/autobib.ss +++ b/collects/scriblib/autobib.ss @@ -171,7 +171,7 @@ (if (author-element? a) a (let* ([s (content->string a)] - [m (regexp-match #rx"^(.*) ([A-Za-z]+)$" s)]) + [m (regexp-match #px"^(.*) (\\p{L}+)$" s)]) (make-author-element #f (list a) diff --git a/collects/setup/setup-unit.ss b/collects/setup/setup-unit.ss index ddffe3647c..37a2239790 100644 --- a/collects/setup/setup-unit.ss +++ b/collects/setup/setup-unit.ss @@ -696,7 +696,7 @@ (setup-fprintf (current-error-port) #f " deleting ~a" (build-path c p)) (delete-file (build-path c p)))))))) ;; Make .zos - (compile-directory-zos dir info #:skip-path compile-skip-directory)) + (compile-directory-zos dir info #:skip-path compile-skip-directory #:skip-doc-sources? (not (make-docs)))) make-base-empty-namespace)))) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;