Skip to content

Commit 8916eda

Browse files
jackfirthrfindler
authored andcommitted
Run Resyntax on drracket/private
Fixed 5 issues in 3 files. * Fixed 4 occurences of cond-let-to-cond-define * Fixed 1 occurence of let-to-define
1 parent 889f55c commit 8916eda

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed

drracket/drracket/private/eval.rkt

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,36 @@
4848
(define port
4949
(cond
5050
[(input-port? input) input]
51-
[else (let* ([text (drracket:language:text/pos-text input)]
52-
[start (drracket:language:text/pos-start input)]
53-
[end (drracket:language:text/pos-end input)]
54-
[text-port (open-input-text-editor text start end values
55-
(send text get-port-name))])
56-
(port-count-lines! text-port)
57-
(let* ([line (send text position-paragraph start)]
58-
[column (- start (send text paragraph-start-position line))]
59-
[relocated-port (relocate-input-port text-port
60-
(+ line 1)
61-
column
62-
(+ start 1))])
63-
(port-count-lines! relocated-port)
64-
relocated-port))]))
51+
[else
52+
(define text (drracket:language:text/pos-text input))
53+
(define start (drracket:language:text/pos-start input))
54+
(define end (drracket:language:text/pos-end input))
55+
(define text-port
56+
(open-input-text-editor text start end values
57+
(send text get-port-name)))
58+
(port-count-lines! text-port)
59+
(let* ([line (send text position-paragraph start)]
60+
[column (- start (send text paragraph-start-position line))]
61+
[relocated-port (relocate-input-port text-port
62+
(+ line 1)
63+
column
64+
(+ start 1))])
65+
(port-count-lines! relocated-port)
66+
relocated-port)]))
6567
(parameterize ([current-eventspace eventspace])
6668
(queue-callback
6769
(λ ()
68-
(let ([read-thnk
69-
(if complete-program?
70-
(send language front-end/complete-program port settings)
71-
(send language front-end/interaction port settings))])
72-
(let loop ()
73-
(let ([in (read-thnk)])
74-
(cond
75-
[(eof-object? in)
76-
(iter in (λ () (void)))]
77-
[else
78-
(iter in (λ () (loop)))])))))))))
70+
(define read-thnk
71+
(if complete-program?
72+
(send language front-end/complete-program port settings)
73+
(send language front-end/interaction port settings)))
74+
(let loop ()
75+
(let ([in (read-thnk)])
76+
(cond
77+
[(eof-object? in)
78+
(iter in (λ () (void)))]
79+
[else
80+
(iter in (λ () (loop)))]))))))))
7981

8082
(define (expand-program/multiple language-settings
8183
eval-compile-time-part?
@@ -228,9 +230,9 @@
228230
[(equal? chars (string->list "WXME"))
229231
(define text (make-object text%))
230232
(send text load-file filename)
231-
(let ([port (open-input-text-editor text)])
232-
(port-count-lines! port)
233-
(values port text))]
233+
(define port (open-input-text-editor text))
234+
(port-count-lines! port)
235+
(values port text)]
234236
[else
235237
(define port (open-input-file filename))
236238
(port-count-lines! port)

drracket/drracket/private/module-browser.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@
123123
(define t (new text%))
124124
(close-input-port p)
125125
(send t load-file filename)
126-
(let ([prt (open-input-text-editor t)])
127-
(port-count-lines! prt)
128-
prt)]
126+
(define prt (open-input-text-editor t))
127+
(port-count-lines! prt)
128+
prt]
129129
[else p])))
130130
(current-output-port (swallow-specials original-output-port))
131131
(current-error-port (swallow-specials original-error-port))

drracket/drracket/private/stick-figures.rkt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@
240240
(define-values (w h) (get-client-size))
241241
(define x (send evt get-x))
242242
(define y (send evt get-y))
243-
(let ([point (find-point this x y)])
244-
(when point
245-
(set! clicked-x x)
246-
(set! clicked-y y)
247-
(set! clicked-point point)
248-
(let ([orig-point (assoc point points)])
249-
(set! orig-x (list-ref orig-point 1))
250-
(set! orig-y (list-ref orig-point 2)))))]
243+
(define point (find-point this x y))
244+
(when point
245+
(set! clicked-x x)
246+
(set! clicked-y y)
247+
(set! clicked-point point)
248+
(let ([orig-point (assoc point points)])
249+
(set! orig-x (list-ref orig-point 1))
250+
(set! orig-y (list-ref orig-point 2))))]
251251
[(and clicked-point (send evt moving?))
252252
(set! points
253253
(map (λ (x)

0 commit comments

Comments
 (0)