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
[`((#%module-begin ,body ...))
(loop body)]
[`((provide/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
[`((provide/dr/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
#`(let #,(map (λ (orig-name ctc)
(define (rewrite obj)
(cond
@ -80,7 +80,7 @@ This file sets up the right lexical environment to invoke the tools that want to
[`(,a . ,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
;; appear in the source of language-object-contract.rkt.

View File

@ -337,7 +337,7 @@ string-constants)
(match sexp
[`((#%module-begin ,body ...))
(loop body)]
[`((provide/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
[`((provide/dr/doc (,x ,name ,ctc ,other ...) ...) ,rest ...)
#`(let #,(map (λ (name ctc)
(with-syntax ([name (datum->syntax #'tool-name name)]
[ctc (datum->syntax #'tool-name ctc)])
@ -353,7 +353,7 @@ string-constants)
[`(,a . ,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))
;; 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/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/drsig
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)
(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
drracket:module-language-tools:add-opt-out-toolbar-button

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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