Fixed drracket/tools-lib so that it exports drscheme:* names

This commit is contained in:
Robby Findler 2010-06-01 19:53:18 -05:00
parent b47569930e
commit 880fa2df0d
16 changed files with 58 additions and 20 deletions

View File

@ -55,7 +55,7 @@ This file sets up the right lexical environment to invoke the tools that want to
(match sexp (match sexp
[`((#%module-begin ,body ...)) [`((#%module-begin ,body ...))
(loop body)] (loop body)]
[`((provide/doc (,x ,name ,ctc ,other ...) ...) ,rest ...) [`((provide/dr/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
#`(let #,(map (λ (orig-name ctc) #`(let #,(map (λ (orig-name ctc)
(define (rewrite obj) (define (rewrite obj)
(cond (cond
@ -80,7 +80,7 @@ This file sets up the right lexical environment to invoke the tools that want to
[`(,a . ,b) [`(,a . ,b)
(loop b)] (loop b)]
[`() [`()
(error 'tools-drs.rkt "did not find provide/doc: ~a" full-sexp)])))])) (error 'tools-drs.rkt "did not find provide/dr/doc: ~a" full-sexp)])))]))
;; these two definitions are a hack. They give bindings for the drracket: based names that ;; these two definitions are a hack. They give bindings for the drracket: based names that
;; appear in the source of language-object-contract.rkt. ;; appear in the source of language-object-contract.rkt.

View File

@ -337,7 +337,7 @@ string-constants)
(match sexp (match sexp
[`((#%module-begin ,body ...)) [`((#%module-begin ,body ...))
(loop body)] (loop body)]
[`((provide/doc (,x ,name ,ctc ,other ...) ...) ,rest ...) [`((provide/dr/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
#`(let #,(map (λ (name ctc) #`(let #,(map (λ (name ctc)
(with-syntax ([name (datum->syntax #'tool-name name)] (with-syntax ([name (datum->syntax #'tool-name name)]
[ctc (datum->syntax #'tool-name ctc)]) [ctc (datum->syntax #'tool-name ctc)])
@ -353,7 +353,7 @@ string-constants)
[`(,a . ,b) [`(,a . ,b)
(loop b)] (loop b)]
[`() [`()
(error 'tools.rkt "did not find provide/doc: ~a" full-sexp)])))])) (error 'tools.rkt "did not find provide/dr/doc: ~a" full-sexp)])))]))
;; invoke-tool : unit/sig string -> (values (-> void) (-> void)) ;; invoke-tool : unit/sig string -> (values (-> void) (-> void))
;; invokes the tools and returns the two phase thunks. ;; invokes the tools and returns the two phase thunks.

View File

@ -13,7 +13,8 @@ all of the names in the tools library, for use defining keybindings
racket/contract racket/contract
racket/class racket/class
;; these have to be absolute requires for `include-extracted' to work with this file. ;; these have to be absolute requires for `include-extracted'
;; to work with this file.
drracket/private/link drracket/private/link
drracket/private/drsig drracket/private/drsig
drracket/private/language-object-contract drracket/private/language-object-contract
@ -45,7 +46,41 @@ all of the names in the tools library, for use defining keybindings
(language-object-abstraction drracket:language:object/c #t) (language-object-abstraction drracket:language:object/c #t)
(provide/doc (define-syntax (provide/dr/doc stx)
(let* ([munge-id
(λ (stx)
(datum->syntax
stx
(string->symbol
(regexp-replace #rx"^drracket:" (symbol->string (syntax-e stx)) "drscheme:"))
stx))]
[definitions '()]
[defthings
(syntax-case stx ()
[(_ case ...)
(map
(λ (case)
(with-syntax ([(id ctc)
(syntax-case case (proc-doc/names proc-doc)
[(proc-doc/names id ctc . stuff)
(identifier? #'id)
#'(id ctc)]
[(proc-doc id ctc . stuff)
(identifier? #'id)
#'(id ctc)]
[_
(raise-syntax-error 'provide/dr/doc "unknown thing" case)])])
(with-syntax ([mid (munge-id #'id)])
(set! definitions (cons #`(define mid id) definitions))
#'(thing-doc mid ctc ("This is provided for backwards compatibility; new code should use " (scheme id) " instead.")))))
(syntax->list #'(case ...)))])])
(syntax-case stx ()
[(_ rst ...)
#`(begin
#,@definitions
(provide/doc #,@defthings rst ...))])))
(provide/dr/doc
(proc-doc/names (proc-doc/names
drracket:module-language-tools:add-opt-out-toolbar-button drracket:module-language-tools:add-opt-out-toolbar-button

View File

@ -35,8 +35,11 @@
[(_ name) [(_ name)
(string? (syntax-e #'name)) (string? (syntax-e #'name))
(let ([name (syntax-e #'name)]) (let ([name (syntax-e #'name)])
(with-syntax ([rx (regexp (format "^~a" (regexp-quote (format "drracket:~a:" name))))]) (with-syntax ([rx-drr (regexp (format "^~a" (regexp-quote (format "drracket:~a:" name))))]
#'(include-previously-extracted scribblings/tools/tool-lib-extracts rx)))])) [rx-drs (regexp (format "^~a" (regexp-quote (format "drscheme:~a:" name))))])
#'(begin
(include-previously-extracted scribblings/tools/tool-lib-extracts rx-drr)
(include-previously-extracted scribblings/tools/tool-lib-extracts rx-drs))))]))
(provide docs-get/extend) (provide docs-get/extend)
(define-syntax (docs-get/extend stx) (define-syntax (docs-get/extend stx)

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "debug") @(tools-title "debug")
@defmixin[drracket:debug:profile-unit-frame-mixin @defmixin[drracket:debug:profile-unit-frame-mixin

View File

@ -1,4 +1,4 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "eval") @(tools-title "eval")
@(tools-include "eval") @(tools-include "eval")

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "frame") @(tools-title "frame")
@defclass[drracket:frame:name-message% canvas% ()]{ @defclass[drracket:frame:name-message% canvas% ()]{

View File

@ -1,4 +1,4 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "get/extend") @(tools-title "get/extend")
@(tools-include "get/extend") @(tools-include "get/extend")

View File

@ -1,4 +1,4 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss" (for-label help/search)) @(require "common.rkt" (for-label help/search))
@(tools-title "help-desk") @(tools-title "help-desk")
@(tools-include "help-desk") @(tools-include "help-desk")

View File

@ -1,4 +1,4 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "language-configuration") @(tools-title "language-configuration")
@(tools-include "language-configuration") @(tools-include "language-configuration")

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "language") @(tools-title "language")
@definterface[drracket:language:simple-module-based-language<%> ()]{ @definterface[drracket:language:simple-module-based-language<%> ()]{

View File

@ -1,4 +1,4 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "modes") @(tools-title "modes")
@(tools-include "modes") @(tools-include "modes")

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "module-language-tools") @(tools-title "module-language-tools")

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "module-language") @(tools-title "module-language")
@definterface[drracket:language:module-language<%> ()]{ @definterface[drracket:language:module-language<%> ()]{

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "rep") @(tools-title "rep")

View File

@ -1,5 +1,5 @@
#lang scribble/doc #lang scribble/doc
@(require "common.ss") @(require "common.rkt")
@(tools-title "unit") @(tools-title "unit")
@definterface[drracket:unit:tab<%> (drracket:rep:context<%>)]{ @definterface[drracket:unit:tab<%> (drracket:rep:context<%>)]{