fix some minor bug and typos in previous commit

svn: r8533
This commit is contained in:
Eli Barzilay 2008-02-05 00:22:33 +00:00
parent 3c72e71e24
commit 3da233dd8e
9 changed files with 34 additions and 30 deletions

View File

@ -1,3 +1,3 @@
#lang setup/infotab #lang setup/infotab
(define name "Framework")) (define name "Framework")

View File

@ -1,3 +1,3 @@
#lang setup/infotab #lang setup/infotab
(define name "Parser-tools")) (define name "Parser-tools")

View File

@ -1,4 +1,4 @@
#lang setup/infotab #lang setup/infotab
(define name "Scribblings: GUI") (define name "Scribblings: GUI")
(define scribblings '(("gui.scrbl" (multi-page))))) (define scribblings '(("gui.scrbl" (multi-page))))

View File

@ -122,7 +122,7 @@ For example, the @filepath{info.ss} file in the @filepath{sirmail} collection
might contain the following @scheme[info] declaration: might contain the following @scheme[info] declaration:
@schemeblock[ @schemeblock[
#lang setup/infotab \#lang setup/infotab
(define name "SirMail") (define name "SirMail")
(define mred-launcher-libraries (list "sirmail.ss")) (define mred-launcher-libraries (list "sirmail.ss"))
(define mred-launcher-names (list "SirMail")) (define mred-launcher-names (list "SirMail"))

View File

@ -45,10 +45,10 @@ grammar of @scheme[_info-module]:
For example, the following declaration could be the @filepath{info.ss} For example, the following declaration could be the @filepath{info.ss}
library of the @filepath{help} collection. It contains definitions for library of the @filepath{help} collection. It contains definitions for
three info tags, @scheme[name], @scheme[mzscheme-launcher-libraries], and three info tags, @scheme[name], @scheme[mzscheme-launcher-libraries], and
@scheme[mzscheme-launcher-names]. (Note the use of #lang!!!!!!) @scheme[mzscheme-launcher-names]. (Note the use of @litchar{#lang}.)
@schemeblock[ @schemeblock[
#lang setup/infotab \#lang setup/infotab
(define name "Help") (define name "Help")
(define mzscheme-launcher-libraries '("help.ss")) (define mzscheme-launcher-libraries '("help.ss"))
(define mzscheme-launcher-names '("PLT Help")) (define mzscheme-launcher-names '("PLT Help"))

View File

@ -60,7 +60,7 @@ EOS
@filepath{info.ss} module, here's a suitable complete module: @filepath{info.ss} module, here's a suitable complete module:
@schemeblock[ @schemeblock[
#lang setup/infotab \#lang setup/infotab
(define name "Some documentation") (define name "Some documentation")
(define scribblings '(("manual.scrbl" ()))) (define scribblings '(("manual.scrbl" ())))
]} ]}

View File

@ -153,7 +153,7 @@ DrScheme continues to start up, without the tool.
For example, if the @File{info.ss} file in a collection For example, if the @File{info.ss} file in a collection
contains: contains:
@schemeblock[ @schemeblock[
#lang setup/infotab \#lang setup/infotab
(define name "Tool Name") (define name "Tool Name")
(define tools (list (list "tool.ss"))) (define tools (list (list "tool.ss")))
] ]
@ -259,7 +259,7 @@ The lists must have the same length.
As an example, the @italic{Essentials of Programming Languages} As an example, the @italic{Essentials of Programming Languages}
language specification's @File{info.ss} looks like this: language specification's @File{info.ss} looks like this:
@schemeblock[ @schemeblock[
#lang setup/infotab \#lang setup/infotab
(require string-constants/string-constant) (require string-constants/string-constant)
(define name "EoPL Support") (define name "EoPL Support")
(define drscheme-language-modules (define drscheme-language-modules

View File

@ -16,28 +16,32 @@
;; get-info/full : path -> info/#f ;; get-info/full : path -> info/#f
(define (get-info/full dir) (define (get-info/full dir)
(define file (build-path dir "info.ss")) (define file (build-path dir "info.ss"))
(define (err fmt . args)
(apply error 'get-info (string-append "info file " fmt " in ~a")
(append args (list file))))
(define (contents) (define (contents)
(with-input-from-file file (parameterize ([read-accept-reader #t]
(lambda () [current-reader-guard
(begin0 (read) (lambda (x)
(unless (eof-object? (read)) (if (eq? x 'setup/infotab/lang/reader)
(error "info file has multiple expressions in ~a" file)))))) x
(err "has illegal #lang or #reader"))
x)])
(with-input-from-file file
(lambda ()
(begin0 (read)
(unless (eof-object? (read))
(err "has multiple expressions" file)))))))
(and (file-exists? file) (and (file-exists? file)
(parameterize ([read-accept-reader #t] (match (contents)
[current-reader-guard [(list 'module 'info
(lambda (x) (or '(lib "infotab.ss" "setup") 'setup/infotab)
(if (equal? x 'setup/infotab/lang/reader) expr ...)
x ;; no need to set a reader-guard, since we checked it
(error "info file has illegal #lang or #reader in ~a" file)) ;; above (a guard will see other uses of #lang for stuff
x)]) ;; that is required)
(match (contents) (dynamic-require file '#%info-lookup)]
[(list 'module 'info [else (err "does not contain a module of the right shape")])))
(or '(lib "infotab.ss" "setup") 'setup/infotab)
expr ...)
(dynamic-require file '#%info-lookup)]
[else (error 'get-info
"info file does not contain a module of the right shape: \"~a\""
file)]))))
;; directory-record = (make-directory-record nat nat key path (listof symbol)) ;; directory-record = (make-directory-record nat nat key path (listof symbol))
;; eg: (make-directory-record 1 0 '(lib "mzlib") #"mzlib" '(name)) ;; eg: (make-directory-record 1 0 '(lib "mzlib") #"mzlib" '(name))

View File

@ -1,3 +1,3 @@
#lang setup/infotab #lang setup/infotab
(define name "XML private")) (define name "XML private")