Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Resyntax fixes #701

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drracket-test/tests/drracket/private/repl-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This produces an ACK message
mred
framework)

(provide/contract [run-test (-> (listof (or/c 'raw 'debug 'debug/profile 'misc)) any)])
(provide (contract-out [run-test (-> (listof (or/c 'raw 'debug 'debug/profile 'misc)) any)]))

(define-struct loc (line col offset))
;; loc = (make-loc number number number)
Expand Down
12 changes: 6 additions & 6 deletions drracket/browser/browser.rkt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#lang racket
(require racket/unit
racket/gui
mred/mred-sig
setup/plt-installer-sig
setup/plt-installer
(require mred/mred-sig
net/tcp-sig
net/url-sig
net/url
net/url-sig
racket/gui
racket/unit
setup/plt-installer
setup/plt-installer-sig
"browser-sig.rkt"
"browser-unit.rkt")

Expand Down
394 changes: 200 additions & 194 deletions drracket/browser/external.rkt

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions drracket/browser/htmltext.rkt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#lang racket/base
(require racket/unit
racket/class
"browser-sig.rkt"
"private/sig.rkt"
"private/html.rkt"
"private/bullet.rkt"
(require browser/external
mred/mred-sig
mred/mred-unit
net/url
net/url-sig
racket/class
racket/gui/base
mred/mred-unit
mred/mred-sig
browser/external)
racket/unit
"browser-sig.rkt"
"private/bullet.rkt"
"private/html.rkt"
"private/sig.rkt")

(define-unit-from-context url@ url^)

Expand Down
4 changes: 2 additions & 2 deletions drracket/browser/tool.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#lang racket
(require (only-in "external.rkt" install-help-browser-preference-panel)
(require drracket/tool
racket/unit
drracket/tool)
(only-in "external.rkt" install-help-browser-preference-panel))
(provide tool@)

;; to add a preference pannel to drracket that sets the browser preference
Expand Down
74 changes: 36 additions & 38 deletions drracket/drracket/drracket.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#lang racket/base
(require racket/gui/base "private/key.rkt" "private/compiled-dir.rkt")
(require racket/gui/base
"private/compiled-dir.rkt"
"private/key.rkt")

(module test racket/base)

Expand All @@ -24,17 +26,15 @@
(flush-output))

(define (run-trace-thread)
(let ([evt (make-log-receiver (current-logger) 'info)])
(void
(thread
(λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
(loop)))))))
(define evt (make-log-receiver (current-logger) 'info))
(void (thread (λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
(loop))))))

(cond
[debugging?
Expand All @@ -57,14 +57,14 @@
(run-trace-thread)))]
[install-cm?
(flprintf "PLTDRCM: loading compilation manager\n")
(let ([make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require 'compiler/cm 'make-compilation-manager-load/use-compiled-handler))])
(flprintf "PLTDRCM: installing compilation manager\n")
(current-load/use-compiled (make-compilation-manager-load/use-compiled-handler))
(when cm-trace?
(flprintf "PLTDRCM: enabling CM tracing\n")
(run-trace-thread)))]
(define make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require 'compiler/cm 'make-compilation-manager-load/use-compiled-handler)))
(flprintf "PLTDRCM: installing compilation manager\n")
(current-load/use-compiled (make-compilation-manager-load/use-compiled-handler))
(when cm-trace?
(flprintf "PLTDRCM: enabling CM tracing\n")
(run-trace-thread))]
[first-parallel?
(flprintf "PLTDRPAR: loading compilation manager\n")
(define tools? (not (getenv "PLTNOTOOLS")))
Expand All @@ -90,19 +90,17 @@
(define (tool-files id)
(apply
append
(map
(λ (x)
(define proc (get-info/full x))
(if proc
(map (λ (dirs)
(apply build-path
x
(if (list? dirs)
dirs
(list dirs))))
(proc id (λ () '())))
'()))
(find-relevant-directories (list id)))))
(for/list ([x (in-list (find-relevant-directories (list id)))])
(define proc (get-info/full x))
(if proc
(map (λ (dirs)
(apply build-path
x
(if (list? dirs)
dirs
(list dirs))))
(proc id (λ () '())))
'()))))

(define make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
Expand Down Expand Up @@ -146,11 +144,11 @@
;; it creates a new custodian and installs it, but the
;; original eventspace was created on the original custodian
;; and this code does not create a new eventspace.
(let ([orig-cust (current-custodian)]
[orig-eventspace (current-eventspace)]
[new-cust (make-custodian)])
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust)))
(define orig-cust (current-custodian))
(current-eventspace)
(define new-cust (make-custodian))
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust))

(dynamic-require 'drracket/private/drracket-normal #f)

Expand Down
70 changes: 34 additions & 36 deletions drracket/drracket/sprof.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#lang racket/base
(require racket/gui/base
framework
racket/class)
(require framework
racket/class
racket/gui/base)

;; how long between samples
(define pause-time 0.1)
Expand All @@ -14,22 +14,20 @@
(define traces-table (make-hash))
(let loop ([i 0])
(sleep pause-time)
(let ([new-traces
(map (λ (t) (continuation-mark-set->context (continuation-marks t)))
(get-threads))])
(for-each
(λ (trace)
(for-each
(λ (line)
(hash-set! traces-table line (cons trace (hash-ref traces-table line '()))))
trace))
new-traces)
(cond
[(zero? i)
(update-gui traces-table)
(loop update-frequency)]
[else
(loop (- i 1))]))))))
(define new-traces
(map (λ (t) (continuation-mark-set->context (continuation-marks t))) (get-threads)))
(for-each (λ (trace)
(for-each (λ (line)
(hash-set! traces-table
line
(cons trace (hash-ref traces-table line '()))))
trace))
new-traces)
(cond
[(zero? i)
(update-gui traces-table)
(loop update-frequency)]
[else (loop (- i 1))])))))

(define (format-fn-name i)
(let ([id (car i)]
Expand Down Expand Up @@ -76,8 +74,8 @@
(send t end-edit-sequence))

(define (format-percentage n)
(let ([trunc (floor (* n 100))])
(format "~a%" (pad3 trunc))))
(define trunc (floor (* n 100)))
(format "~a%" (pad3 trunc)))

(define (pad3 n)
(cond
Expand Down Expand Up @@ -110,16 +108,16 @@
(define/override (on-event event)
(cond
[(send event button-up? 'left)
(let ([admin (get-admin)])
(when admin
(let ([dc (send admin get-dc)])
(let-values ([(x y) (dc-location-to-editor-location (send event get-x)
(send event get-y))])
(let* ([loc (find-position x y)]
[para (position-paragraph loc)])
(set! clicked-srcloc-pr (and (<= 0 para (last-paragraph))
(car (list-ref gui-display-data para))))
(update-gui-display))))))]
(define admin (get-admin))
(when admin
(let ([dc (send admin get-dc)])
(let-values ([(x y) (dc-location-to-editor-location (send event get-x)
(send event get-y))])
(let* ([loc (find-position x y)]
[para (position-paragraph loc)])
(set! clicked-srcloc-pr
(and (<= 0 para (last-paragraph)) (car (list-ref gui-display-data para))))
(update-gui-display)))))]
[else (void)]))

(define/public (set-gui-display-data/refresh traces-table)
Expand Down Expand Up @@ -187,11 +185,11 @@

(define/public (open-current-pr)
(when clicked-srcloc-pr
(let ([src (cdr clicked-srcloc-pr)])
(when (path? (srcloc-source src))
(printf "open ~s\n" (srcloc-source src))
(when (number? (srcloc-position src))
(printf "go to ~s\n" (srcloc-position src)))))))
(define src (cdr clicked-srcloc-pr))
(when (path? (srcloc-source src))
(printf "open ~s\n" (srcloc-source src))
(when (number? (srcloc-position src))
(printf "go to ~s\n" (srcloc-position src))))))

(define/private (update-info-editor pr)
(send vp change-children (λ (l) (if pr (list ec1 lp) (list ec1))))
Expand Down
Loading